(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "The Transactor Magazine Volume 5 Issue 06"

p^ 



■J 




t/1 



90% Advertising IHree! 



Issue 06 
$2.95 



M g7iItT¥;TriTiiTr^ l^ 



^Te Tools For Saueezfng The Most From Your Commodore Computer 



j t P: Execute Sequential Files 
^A^.^. -ng The Error Wedge 

ftware Numeric Keypad 

[ cacroiiing Mouiine 

Jirectory Gap Remover 

i^.i.uExtramnn64 

Orive Peeker 
Quote Killer 



f HI-RES Printer Dump 

RES Graphics Utility 

Two^ort Sprite Editors 

VIC (I Chip Parameters 




Volume 5 
Issue 06 

Circulation 63,000 









Start Address Editorial 3 

Bits and Pieces . 4 Letters 17 

C64 \RQ reset Upgrades and Info: DOS 2.7 

80 Column Right- Justify Clearly InflextbJe: Screen Clear RouUne 

CGA Zero Page View Projection Reflection 

C64 V2 ROM Colour Memory Fix Unimplemenled Inquiry: 6502 Ops 

SYScreecfiing Off Into Oblivion 

Disabling RESTORE on c64 »% »% w^ m^ 

Fast Hi-Res Screen Clear From BASIC NCWS BRK 76 

In Search of. . The perfect colour combination >jew 16-bit Commodores for 1985 

Put Mental Notes on Disk (or tape)! Note to Product F^eview Authors 

Assembler Programming Tip Over 4 1,000 Attend World of 

One Line Decimal To Binary Conversion Transactor Disk Offer Update 

The Sleeper IBM COMAL 

40 Column Wordpro Dump "^^^ Gold Disk 

p^„l(, Quick Data Drive For C64 and VIC-20 

Warm Start Border Rasher Software Developers Newsletter 

r> 1.1 i.Fj.i. n 1 rx- . n- . . Commodofe Now Providcs AmeMcan 

Double Wjdlh Dtsk Directory Printout ^AMP: Uteralure Analysis of Microcomputer Publications 

C64 Easy Disk Status Porthote 

Bounce 8032 ^^ Income Tax Program For Commodore PLUS/4 

Filename Extensions With SHIFTed SPACE iNFOQUICK Bulletin Board for The Commodore 64 

Easy Screen Print The SMART 64 Terminal + 4 

Phone Speller The FONT FACTORY 

Assembler Programming Tip -2 CAM-64 [Call Accounting Manager) 

1541/4040 Write Incompatibility Bug Expandable 300/1200 Baud Modem 

Auto Keywords For The VIC, 64. PET/CBM Printer Ribbons 



Introducing VERIFIZER 11 

The MANAGER Column 13 

TransBASIC Installment *2 19 

A New Wedge For The Commodore 64 .... 22 

Keywizard For The Commodore 64 26 

LINKED LISTS Part 2 31 

A HI-RES Graphics Utility 37 

VIC Parameters 45 

BIGPRINT: Hl-RES Printer Dump 48 

Two Short Sprite Editors 50 

List Scrolling Routine 52 

STP: Execute Sequential Files 54 

Quote Killer 56 

Directory Gap Remover 57 

Machine Language Print Loader 58 

Aligning The 1541 64 

Super Cat 66 

Software Numeric Keypad 67 

Disk/Extramon 64 68 

Drive Peeker 71 

File Compare 72 



Hm IWinMictor 



1 



Volume 5, liHi* 06 



Iransaclor 

ThB TKh/MBHi JDumal Far (*«■■■*>*#•'• C<MpMf ra 



Managing Editor 

Karl J. H. Hildon 

Editor 

Richard Evers 

Tectinicai Editor 

Chris Zamara 

Art Director 

John Mostacci 

Administration & Subscriptions 

Land Humphries 

Contributing Wrllers 

Harold Anderson 
Don Bell 

Daniel Bingamon 
Jim Butlerfield 
Gary Cobb 
John Currie 
Elizabeth Deal 
Domemc DeFrancesco 
Brian Dobbs 
Bob Drake 
Ted Evers 
MikeForani 
Jeff Goebel 
Gary Gunderson 
David A. Hook 
Rick liles 
ScoU Johnson 
Garry Kiziak 
Michael Kwun 
Scott Maclean 
Allen R. Mulvey 
Brian Munshaw 
Noel My man 
Lenard Painchaud 
Michael Quigley 
Howard Rote n berg 
Louis F.Sander 
K.Murray Smith 
Darren J. Spruyt 
Aubrey Stanley 
Nick Sullivan 
Colin Thompson 
Mike Todd 

Production 

Attic Typesetting Ltd. 

Printing 

Printed in Canada by 
MacLean Hunter Printing 



Program Listings In The Transactor 



4 



All program.^ listed in The Transactor will appear as they would on your screen in Upper/Lower case 
mode. To clarify two potential character mix-ups, zeroes will appear as '0" and the letter "o" will of course 
be in lowercase. Secondly, the lower case L('r) has a flat lop as opposed to the number 1 which has an 
angled top. 

Many programs will contain reverse video characters that represent cursor movemenlSj colours, Of 
function keys. These will also be shown exactly as they would appear on your screen^ but they're listed 
here for reference. Also remember: CTRL-q within quotes is identical to a Cursor Down, etal. 

Occasionally programs will contain lines that show consecutive spaces. Olten the number of spaces you 
insert will not be critical to correct operation of the program. When it is, the required number of spaces 
will be shown. For example; 



print 



flush right" - would be shown as - print" [space 10] flush right' 



Cursor Characters For PET / CBM / VIC / 64 



Down - 

Up 

Right - 

Lefi - [Lft| 

RVS 

HVSOff- 



hisert 

Delete - 

Clear Scm - ■ 

Horn? 

STOP 



Colour Ctiaracters For VIC / 64 



Black - 
While - 
Red - 
Cyan - [Cyn 
Pufple - [Pur] 
Grv«ii ^ ■ 
Blue - ■ 
YeUow- lYel] 



Orange - 
Brown 

Lt^Rcd - 

Grey 1 - 

Grey 2 - 

Lt. Green - 

Lt. Blue - 

Grey 3 - 



lGr3] 



Function Keys For VIC / 64 



Fl 
F2 
F3 
F4 



F5 
F6 
F7 
F8 



The TraniacloE is published bi-monthly by Transactor Publishing Inc., SOO Sleeles Avenue, Nlilton, 
Onlaho, LST3P7 CanadLan Second Class mail regi^lralion number 6142. USPS 725-050, Hecund Class 

Kfilafie paid a1 ^ufialo. NY, tor U.S. subscribers US Po5Uiid!>ler& iend address changes lo The 
ansaclor, 277 Unwood Avenue, Buftalo, NV, 1420&, 716-8S4063U ISSN' 0827 -2530. 

The Transaclor is in no way connecled wilh Commodure Business Machines Lid or Commodore 
Incorporaled- Commodore and Commcxlore producl names fPET, CBM, VIC, M) are registered trade- 
mark o\ Commodore inc. 

SubscrLptions 

Canada tl5 Cdii U.S.A. JI5 US. All olher $21 US. 
AirMaii[OverHdson]y)S40US. (S'l.l&poaEage/iSSLiel 

Send «]] (ubKriptionB lo: The Transactor, Subscriptions Department, 500 Sleeles Avenue, Hillon, 
OntarioXanj(ld.L9T3P7. 416 fi76 4741 Fnjm Toronto call 325 1662 Note Sub!;rriplinns are handled at 
this address ONLY. Subscriptions seni to our Bulfalo address labove) wilL be forwarded lo Milton H(J 

Back Issues' $4.50 each. Oidet all back issues Trom Milton HQ. 

SOLDOUT:TheBeslo!ThcTransaclorVolumesl&2&3, Volume 4, Issues 04, 05, 06 

Sttit AvBiliible:Vol 4 01 , 02. 03 Vol 5; 01 . 02, 03, 04, OS 





QiUQtity Ortlers: 






EH«TWBUTIHa 


CompuLII Micron Distributing 
PO Box 352 409 Queen Street West 
Port Coquittam, BC Toranlo. Onldnu, MSV 2A5 
V5C4Kfi (416)5939862 
604 438 8B54 Dealer Inquiries ONLY 

1 SOO 26S 9052 
U SA. astiibutor: Subscripfion related inquiries 
>7 .- ^ are handled ONLY at Milton HQ 


* 


Capital DisTnbuling 

Charlton Building 

Derl>y,CT 

06418 

(203) 735 3381 

(or your local wholesaler) 


Master Media 
2fil WyecroFlRoad 
O^kviJFe.Ocirario 
L6J5B4 

116)842 1555 

:>r your local wholesaler) 





Edhlor^al koailrabulioiis are aLways %^elcomc Writer? are er]muraged lo prepare maleri^L acrqrding lt> 
themes ^ shown in Edilorjal Schedule (see lisl near Ihe end of Ihls jssue). Remuneralion is i40 per 
pnntod page. Preferred rnedJa hS 1541. 2031. 4040. 8050. or 8?50 diskeTles with WordPro. WordCraft. 
SupeT-script. or SEQ lexl hies Prc>grarn lishngs uver 20 lines shoijld he provided on disk or tape. 
Maiiu-^npts should be ivpewriuen. double spaced, wjth special characters or formats clearly marked. 
Photos of authors or equipment and allustralions will be included wilh arlhcles depending on quality. 
Dinettes, tapes and/or photos will be returned on request. 



AJI material accepted becomes Ihe property o! The Transador All materia! is copyrighl by Tr^nsaclor 
Publlcalions Inc. Rcproduclion in any form wilhour permission is ]n vtoialioti of applicable laws Please 
reconfirm any permissions slanted pnor lo Ihjs notice Solicited material is at-tiepled on an all rights 
tjasis only. Write lo Ihe Mtllon address for a writers pjckage. 

The opinions ej:pressed in contributed articles are nol necessarily Ihose of The Transactor. Although 
accuracy is a major objective. The Transatlur cannot assume liability for errors in ailKlesor programs- 
PrMFfamslisledm The Transactorare public domajn: tree to copy, nottowll 



Ttw'franfloctor 



Volume 5, iMua 06 



■ S':^ ^, 



Nowhere is the desire lo absorb information more prevalent 
than in the field of microcomputers. Equal maybe, but not 
more. Of course we all like to learn more about our favourite 
subject. Just one problem. We live in a mass market society 
where things are only available for as long as a marketable 
segment of the population shows a need. Information is no 
exception. So unless there is a need to continue developing a 
subject, the availability of new information will not only reach a 
limit, but the need for more will also level off. 

The law of '"supply and demand" affects all businesses. In the 
micro industry, manufacturers are responding every year with 
machines that exceed every specification of its predecessor 
except price. The information industry bareiy has a chance to 
cover all the angles of the current technology before a new line 
comes along that requires more of the spotlight. Fortunately for 
us there have not been enough transitions to force discontin- 
ued coverage of any one model. However, Commodore is 
releasing new machines and the story next year will not likely 
change. Eventually we just won't have room lo deal with 
everything. Recognizing this outcome was one reason behind 
the theme of this issue and also some slight modifications to 
our philosophy. 

We realize that the majority of computer users have defined an 
objective for their computer and are either working towards 
that objective or enjoying the results of having accomplished 
that objective- And with kind treatment there is no reason why 
the hardware shouldn't endure indefinitely. In fact, that same 
computer may never be asked to perform another new duty. 
Then, when you least expect it, the day will come when change 
commands priority. Depending how far away that day is, the 
information that was once so readily available just might be the 
most difficult to locate. Even the most weathered experts may 
be unable to offer enough detail to help pinpoint a solution. 

But with enough of the right tools, any problem under any 
circumstances can be eliminated. You've heard the saying, '1f 
you want it done right, do it yourself". Well that's fine if you 
know how to tackle it, which is usually determined by how 
much information you can accumulate to provide answers. 
Thus the "utility" was born - a program that does no favours 
for the user except to make the process of accumulating 
information less intimidating. 



It was around the same time that the "programming aid" 
became a natural development. Once enough information has 
been gathered to formulate an idea, the next step is implemen- Kar! J.H. Hildon. Managing Editor 



tation. Programming aids won't provide many answers, but 
unlike utilities their intent is to do all the favours the user 
expects to make the process of applying all that accumulated 
information less intimidating. 

The philosophy of The Transactor has always been to dissemi- 
nate information. With this issue, the information we've cho- 
sen to disseminate is for the purpose of extracting information 
as defined by the individual who requires it. We can't possibly 
supply all the answers, even if we knew all the questions. So 
the next best alternative is to offer methods to magnify the 
questions so the answers might be seen more clearly, and to 
offer a little assistance with the task of implementing the 
solution. But that's not the most significant benefit. 

Learning is a daily process that we ail experience, consciously 
or otherwise. But there is another learning process that too 
many of us ignore even as we're gathering new facts; the 
process of learning how to learn. The ability to systematically 
obtain knowledge is what separates those with the skill of total 
recall from those with the talent for discovering. If you can 
pioneer a dilemma to its defeat, you have accomplished more 
than the original problem. Whether you realize it or not, you 
are acquiring discipline. And with each new accomplishment 
you acquire a little more. Eventually your battles with new 
objectives will become merely an exercise in accomplishment. 
The logical and systematic approach that is so essential in 
computer science will proliferate into other unrelated functions 
of your day to day existence. The intimidation of a new frontier 
will fade faster as you learn to ask why a problem exists and 
eliminate the problem reason by reason instead of ail at once. 

The art of problem solving is one that man has been trying to 
perfect since time began. The concept of computers would 
never have materialized had there been no struggle with 
question. Now that we have the computer we must remember 
that it can only solve problems given enough information, and 
it's the information we supply that determines how valuable 
the solutions become. If new solutions do not require new 
technology then your old computer may never become obso- 
lete. 



However, there's nothing as constant as change, I remain. 




Tli« Ib-ontocTor 



Vdluiw 5, laaug 06^ 



Bits and Pieces 



■;> ■ 



C64 IRQ reset 

You know the problem: you want to disconnect an IRQ-driven 
program, but a RESTORE will also reset other things like your screen 
and border colours. Here's an easy way to set the IRQ vector back to 
its normal entry point of $EA31: 



or in assembler: 



poke 781, 12: sys 64701 

1dx#12 

jsr $fcbd 



80 Column Right-Justify 



'@\ then you have ROM version 2, With this ROM, the kernal routine 
which clears a screen line 'cleverly' fills the corresponding colour 
memory with the background colour. Since background equals fore- 
ground the result is a truly clear screen. Furthermore, if you've ever 
run a program for the 64 or typed in a little screen blitz from a 
magazine that didn't work, it could be because the author wrote it on a 
VI or V3 machine and assumed it would work on any 64, 

The solution? If you're willing to forsake the RAM underlying the 
kernal ROM for this cause, you can correct the foolish behaviour by 
changing just two bytes. First copy the BASIC and Kernal ROM into 
the underlying RAM. If you have a Machine Language Monitor with a 
Transfer' command (like Supermon or Micromon), this can be done 
with these two operations: 



The ultimate one-liner: when there's a bunch of stuff on the screen of 
your 8032, enter this; 



fo^i = 1to80:?''■^:forj = 1to24:?''■^nextj,i 



(The reverse '■" is an insert). 8000 Series PET/CBM owners, 
starting the line with: 

poke 21 3, 159 



..try 



taOOObfffaOOO 
t eOOO ffff eOOO 

This transfers the contents of the 8K BASIC ROM and the 8K Kernal 
ROM into RAM. But it gets it torn ROM. . . whydoesit not try loput it 
back in ROM? Because the 64 knows you can't possibly mean that 
thanks to a chip called a FPLA (Field Programmable Logic Array}. This 
redirects data flow to a logical destination that has been preset by the 
engineers. And yes, it's fast! 



Quick note: when using the non-relocattng load as in: load 
"filers,! you can use any non-zero value instead of 1, so 
you can use ,8*8 to make typing it in a little easier. 



Next switch out the ROM and switch in the RAM by putting a 53 
decimal into the bank select register (location 1): 

BASIC; poke1.53 
Monitor: : 0001 35 



C64 Zert> Page View 

On the PETs. a good way to gel a look at what's going on in zero page 
was to run an in lerrupl-d riven routine which would continously 
display the contents of zero page on the screen. Well, on the 64, 
there's an easier way: 

poke 53272.7 (.23 to gel back to normal) 

This tells the VIC-!I video chip to find screen memory at $0000, giving 
you a dynamic view of what's going on there. If you have V2 ROMs, 
you'll have lo fill colour memory with something other than back- 
ground colour to see it, or use the ROM change method below. 

C64 V2 ROM Colour Memory Fix 

If you have a C64» try this: clear the screen, move the cursor down a 
line or two, then type: 

poke 1024,0 

If you see an '@' on the top left of the screen, then you have ROM 
versions 1 or 3, Consider yourself lucky; you can freely POKE to 
screen memory and see the results of your efforts. If you don't see the 



Now, at $E4DA, there is the instruction: 



Change this to: 
like this: 



LDA$D021 
LDA $0286 
:e4db86 02 



($0286 holds the current cursor colour) 

The kernal will be living out of RAM from now on, but POKEing to 
the screen will always yield visible characters. Seems like a lot of 
work tor just poking to the screen, especially when you could Yys^je 
merely changed the background colour. But there was another 
reason for this excercise (of course). 

Now that you have all of your 64 operating from RAM, anything 
can be changed. The spelling of keywords and error messages 
are fun to modify, but more importantly the ROM routines can be 
altered, JMP Instructions can be re-routed or entire routines can 
be substituted. Most common is the "BRK instruction insert" for 
examining the state of the machine at any particular point in a 
routine. With your favourite dissassembler you simply change the 
first instruction beyond the last instruction you want executed to a 
BRK ($00). Now when you cause that parttcular stretch of code to 
execute It will stop at the BRK and you can peer around awhile. 



Th« IVvntoctor 



Volumo 5, l»utt 06 



Logically you should be able to replace the BRK wilh the instruc- 
tion you wiped out and continue executing. Some routines will 
allow such interruptions but others aren't so tolerant. Most likely 
you'll need to replace the BRK and start over {perhaps with a BRK 
somewhere else?), 

SYScreeching Orrinto Oblivion 

On any BASIC 4.0 machine, you can easily enter the monitor with 
SYS4, right? Well, try it with a quote after the 4 like: 

SYS 4^ 



Put Mental Notes on Disk (or tape)! 

Ever compose your thoughts idly on the screen of your computer? Or 
draw a neat picture using graphics symbols while idly talking on the 
phone? Want to save the screen to disk or tape to bring it in again 
later? Enough questions, here's what to do. Last issue's Bits & Pieces 
gave a method to save a range of memory. To save the screen (at 
$0400 on the C64): 



sys5781 2 "filename \8:poke193,0:poke194,4: 
pokel 74,231 :poke1 75,7;sys62954 



(use ',1,1'for tape) 



What happened? We won't spoil it by giving it away - look up the Of course, that'll mess up a bit of the screen: that's the catch. To bring 
purpose of location 4 to figure it out, back your screen, just LOAD it any time with: 



Disabling RESTORE od c64 

If you don't want someone crashing out of your program with the 
RUNSTOP/RESTORE sequence, here's an easy way to disable it: 



poke 792, 193 (,71 getsback to norma 



The disable POKE pretty much renders the NMl routine impotent, so 
RS-232 operations won't work while it's in effect. 



Quick Note: 255-x = 256+not(x) 



Fast Hi-Res Screen Clear From BASIC 

Last issue's Bits & Pieces gave a little machine language routine to 
quickly clear bit-mapped memory. Since then Nick Sullivan from 
TPUG magazine showed us this neat trick to accomplish the same 
thing from BASIC. If you create a large array and then CLR it, BASIC 
will zero out anything in its path, including hi-res screen memory if it 
happens to be in the way. If you have a hi-res screen within the limits 
of BASIC variable space, just put this line at the beginning of your 
program; 

cir: f^fre(0):dim a((-65536»(f<0) + f)/5-10); cir 

That's it! Within a second, the screen will clear. You can't use this trick 
if your screen memory is at SCOOO, but at the usual spot at $2000, and 
with BASIC pointers set up normally, it works like a charm. 

In Search of. . . The perfect colour combination 



load"filename\8,1 orloadMilenarne'pl.l fortape 

With a BASIC 4,0 machine, just use the monitor to save the screen: 

Qys4 

s''fifename\08,8000,83e7 
(,8000,87cf for 80 column machines) 

Unfortunately you can't save memory above $8000 to tape. Pardon 
me. . . you can save it to tape, you just can't LOAD it back. Commo- 
dore never expected anyone to require memory at>ove $8000 to be 
saved so they used the high bit of the address for something else. In 
the VIC or 64 this anomoly has been dealt with and whatever that bit 
does is now seperated into its own byte. 



Assembler Programming Tip 

Branch instructions like BNE, BEQ, BPL, etc. can beapain when your 
program grows and the branch can't reach the intended destination 
any more - the assembler gives a " BRANCH OUT OF RANGE " error. 
You can get around this problem by branching to a JMP somewhere, 
but for a short easy way to do long branches, consider this: 

intended branch : BNE SOMPLC 

easy long branch: BEQ • + 5: JMP SOMPLC 

This leaves the intent of the branch clear, and doesn't force you to 
define a meaningless label somewhere. 



One Line Decimal to Binary Conversion 



Looking for the perfect background/ border/ character colours for Store the value (0-255) to be converted in 'x\ then: 

programming on theC64 wilh a 1701/1702 monitor? Try this; 

2$ = ■■ ■■ :forj - Oto7:k = xy2;x = int(k) 

poke 53281,0: poke 53280, 11 (press Commodore-2) :2$ = mid$(str$(k<>x),2) + z$;nextj:printz$ 



For the VIC: 



poke 36879,9 (press CTRL-8) 



Adjusting the bright/contrast controls to look good with this combina- 
tion results in an easy-to-look-at screen for hours of programming 
without fried retinas. 

Quick Note: If proceAsing time is critical, you can speed up 
the CPU by turning off the VIC-11 video chip in the c64: poice 
53265,peek(53265) and 239. 



The Bleeper 

This little noisemaker runs on any PET wilh CB2 sound: 

10poke59467,16;fora^1to255:poke59466,a 
:forb==1to255slepa:poke59464,b:nextb.a 
20 print chr$(7) 



Th« l^ontoctor 



Volumo 5, i»ua 06 



40 Column Wordpro Dump 

Here's a small program that will print out a Wordpro-format text file to 
the screen. It will work with Paperclip, but there will be a few bytes of 
garbage printed at the beginning as Paperclip stores extra information 
at the start of its files. 

1 rem* print a wordpro fife to screen 

20 rem* 40 column version for 4032/c64 

100 input' filename ^f$ 

110open1,8,0.''0:" +f$ 

120 b= 1984 

130 rem b = 33728 for 4032 

150 cc = p eek(646): c ^ 54272: rem* only for 6 4 

1 60 print " ^J^BBBfflff ppi fflBI IIBBBBM ' 

165 rem 25 cursor downs 

170 9et#1,a$,a$ 

175 rem- main loop - 

180fori = btob + 39 

190get#1,a$: poke i,asc{a$ + chr$(0)} 

210 pokec + i,cc: rem* only tor 64 

220 if St then 250 

230 next i: pnnt;goto180 

240: 

250 closel :Gnd 



Regain 



Lenard Paine haud 



5 rem* restore pgm after reset or new • 

10ad = 49152;fori = 0lo21 

20 readd:pokead + i,d:nexti 

30 data 169,8,141 ,2,8,32,51,165.24 

40 data 165,34,105,2,133,45,165,35 

50data105,0J33,46.96 

60 print'toexecute this program, use:" 

70 print" sys";ad;":clr'' 

Lenard writes: ' It comes in handy when a program crashes and you 
canH get your cursor back. Before you can use this program, however, 
you need a reset switch. When you turn on your computer, load and 
run the regain program. Now, when the computer crashes, press the 
reset switch. That doesn't do the trick though. You then have to type 
sys 491 52. Now you will have your program back. You can change the 
memory location where the ML program is stored by changing the 
value of AD in line 1 0. " 



10fora = 49152to49169;readb:pokea,b:c = c + b:nexta 

20 ifcOl 779thenprint " checksum error! ' :stop 

30 sys49 1 52 

40 priril " basic warm start flasher activated " 

50 data 169,11,141.2,3,169,192,141,3 

60 data 3,96,238,32,208, 76,131 ,164,0 



Double Width Disk Directory Printout 



Brian Dobbs 



A« 



«* 



The following little program will give you a disk directory in two 
columns, useful for printing out and putting in tlie disk sleeve. If 
sending tlie directory to the screen, it will appear as a normal 
directory on a 40 column screen, and double width on an 80 column 
screen, 

100 rem** directory double width *• 

110 rem** by brian dobbs 

120 rem** timmins, Ontario 

130 k^ 4: rem* k = 3 for screen, 4 for printer* 

135 r = 1; open k,k 

140dr==0: rem* directory drfve zero * 

150 gosub 220; rem* directory subroutine 

160dose3 

1 70 input " another (y/n) " ;an$ 

ISOifanSO^-tfienend 

190 print "insert another disk, press any key" 

200geta$;ifa$<>^ "then200 

210goto130 

220n$ = chr$(0):h = 256:open1,8,0,"'$^+mid$(str$(dr),2) 

230get#1,aS,aS 

240 gel#1 ,aS,a$,a$,a1$: if si then 290 

250 d = asc(a$ + n$) + asc(a1 $ + n$)*h: print#k,d; 

260get#1,a$:ifa$<>" "thenprint#k,a$;;golo260 

270r = r+-1:ifr = 2thenr = 0;prlnt#k:goto240 

280d$ = str${d):print#k,lab(40);:golo240 

290 closel 

300 return 



C64 Easy Disk Status 



John Currie, Mississauga Ont> 



Thlstidylittleroutinesitsin the cassette buffer at 828, and will display 
the current disk error status when executed. Us very handy, since the 
C64 has no built-in disk status function. 



Note: To reset your computer, you have to momentarily ground pins 3 
on the user port - prn 1 is a ground. Connecting a push button across 
pins 1 and 3 makes a good reset switch - h can save your program's 
life! The above program will also bring back a program after a NEW. 



Warm Start Border Flasher 



Nick Barrowman 
St, John's, NFLD. 



Nick writes: " This small routine doesn't serve any practical purpose 
but it is an example of how you can use the main basic program loop 
vector in the C64 (warm start link at $0302). A more practical purpose 
is auto-run routines. This routine wili change the colour of the screen 
border whenever <return> is pressed (from BASIC) or when a break 
or restore is performed. Hope you like il! " 



100 rem basic loader for disk status 
110a = 828 

1 20 read b:c = c + b:if b = 256thfen 1 40 
130 poke a,b:a = a+1:goto120 ■ 
140 if c<>6574then print " error in data stateements 
150 print " 'sys 828' returns the current disk status" 
160data169. 0. 32,189,255,169. 15J62 

15, 32, 186,255, 32,192 



170 data 8. 160, 
180 data 255, 162, 15, 
190data141. 19. 3. 
200 data 3,238. 19, 
210 data 13,208,240, 



32, 198,255, 169, 
32,228,255,172, 19 
3,153,127, 3,201 
32,204,255, 169, 15 
220data 32,195,255,160, 0,185,127. 3 
230 data 170, 200, 32,210,255,224. 13.208 
240 data 244, 96. 0,256 



end 



Tb« lyanioctor 



Vbtum* 5, Uiue 06 



Bounce 8032 

Here's another one of ihose useless little special effects. For some 
reason though, this one can hold your attention for hours (well, 
minutes maybe). It only runs on 8032*s, since it uses the scroll down 
feature unique to that machine. 

5Ep = 32768:forj-0to1step0;s=153-128"k:k=1-k 
10fori = 1tornd(1)'15:printchr$(s): 
:pokesp + rnd(1)'1000,46:nextij 



Filename Extensions With SHIFTed SPACE 

Filename extensions such as .SEQ. ,ASM. ,OBJ, etc. are useful lo 
indicate file types, but some programmers prefer lo use a shifted space 
instead of a period in the filename. Such a file will be listed in the 
directory with the extension OUTSIDE the quotes around the fi- 
lename. To load the file back in, you can specify the filename without 
the extension, or specify the entire filename (including the shifted 
space) if greater uniqueness is required. You can also use tfiis method 
to make " notes ' about a file — the note will show up in the director}' 
but need not be entered to load the file jil 



100 rem* phone speller ' 

110 rem* 6ec8Afcz * 

120: 

130open1,3 :rem 1 ,4 for printer 

1 40 1$ = " 0001 1 1 abcdefgfiijklmnoprstuvwxy " 

150: 

1 60 input " phione number " ;pn$ 

170n = len{pn$) 

160dimp(n), n${n) 

190; 

200fori = 1 ton 

210n$(i) = mid$(l$.val(mJd$(pn$,i,1))*3 + 1 ,3):p(i) = 1 

220 next i 

230 rem" n$ holds letter groups for each digit in number * 

240: 

250fori = 1to3tn 

260print#1 j, 

270forc=1 ton:print#1,mid$(n$(c),p(c},1)i:nextc 

;prinl#1,cfir$(13); 
280 carry = 1 
290forj = lton 
300 p(j) = {p(j) + carry)' carry = 
3 1 if pti)>3 then carry = 1 :p{j} = 1 
320 next jj 



Easy Screen PrinI 

A powerful and little-used feature of Commodore BASIC is the ability 
to use a screen file for INPUT, If you open a screen file and then GET 
or INPUT from that file, you will read characters directly from the 
screen starting at the cursor position, and advance the cursor to the 
next character or INPUT field. 

There are all kinds of uses for screen input, but a good application is to 
convert screen memory character codes to their CBM ASCII equiva- 
lents. Such conversions are necessary when printing all text on the 
screen to a printer. The following line of code will dump an S032's 
screen to a Commodore printer with an 80 column margin width. 

1 open3,3:open4,4:pnnt" J";:fori = 1to80:9et#3.a$ 
:print#4,a$;:nextxlose3:dose4 

For 40 column machines or a printer set for column widths greater 
than 80, use this version — it prints a carriage return every 40 
characters; 

1 open3,3:opGn4,4:pnnIchr$(19);:tori=^1to24 
2forj=1to40:get#3,a$:print#4,a$;:nextj:print#4," ":nexti: 

close3.close4 



Assembler Programming Tip *2 

if you've ever looked through someone's machine language program 
and come across a seemingly useless BIT instruction (eg. BIT SFFA2), 
or an inexplicable .BYTE $2C, there is a method lo his madness. 

The BIT instruction doesn't do any harm to memory or CPU registers, 
it just sets the zero, minus, and overflow flags based on the contents of 
the given memory location. In some instances, BIT is used almost like 
a NOP, but with one major difference: the two operand bytes used to 
specify the memory location are part of the instruction, and so are not 
executed as instructions if the BIT is executed. If the first byte of the 
instruction ($2C) is skipped however, you can execute a 2-byte 
instruction- For example, consider the following assembler code: 

ENTRY1 .BYTE$2C 
ENTRY2 LDX#$FF 

If a program were to execute the code starling at ENTRYl, the CPU 
would see a $2C which is a BIT instruction, and interpret the next two 
bytes (the LDX instruction) as the argument for the BIT — in this case, 
the CPU would see: 

BIT SFFA2 



Phone Speller 

Some telephone numbers are most easily remembered by the letters 
on the dial. For example, you can gel information on 1985 Volks- 
wagens by calling 1 -800-85-VOLKS. Wouldn't it be nice to give your 
friends a similarly catchy way to remember your number? The 
following program (it works on any machine) gives all letter combina- 
tions from any phone number (zero and one have no associated 
letters, so or 1 appears). There are 2,187 combinations for a 7 digit 
number, so be prepared for a long list. And even if there are no 
pronounceable words in the list, you can invent acronymns. What 
better way to spend an afternoon than to find phrases to fit 2,187 
acronyms? 



If the S2C was skipped over and instructions were executed from 
ENTRY2, the CPU sees the bytes SA2, $FF and interprets the LDX 
*$FF instruction normally. 

Using the above technique allows you to enter a routine with the X 
register intact, and later enter the routine one byte past the start and 
have the register changed to something else before the routine does its 
thing. Of course, any register may be used instead, or any I or 2 byte 
op code can be executed after the $2C. 

The technique is explained here in case you come across it in 
someone else's program, since it's a fairly widely used and accepted 
6502 programing practice. Generally though, programmers who use 
tricks like this enjoy writing obscure code to save a byte or two of 



Th# TrariKictor 



Volum» 5, Is>ue06 ] 



memory, and don'l care if anyone else can look al ihe program and 


window over any part of the command set (ie. the part you use most). 


understand it. Many programs, including those printed in the Transac- 


Check out any list of keywords for your optimal window. 


tor, are designed lo be easily read by people, not computers, and 




should keep away from such brain-twisting exercises. But giving such 


As shown, the program will give you the first 26 keywords. Since the 


advice to a hacker is about as effective as advising a kid not to step in 


first keyword is "END", a shifted-A will print ''END". Vary location 


puddles on his way home from school. 


683 from 12810 193 for the PET/CBM, or location 882 from 143 to 193 




for the VIC and C64. Lower values will move the window over the 




error messages. 


1541/4040 Write IncompatiblUty Bug 






Note For PET/CBM Users: Reset IRQ before LOADing from disk, then 


When the 1541 single disk drive arrived, so did a new buzz word: 


sys(634) to start again. The C64 and VIC do not have this bug, but the 


Vrite-compalible^', At first it seemed that diskettes were completely 


PETs sure do. The machine will hang until the STOP key is pressed if 


portable tjetween 4040 and 1541 drives. Then reports of some nasty 


any IRQ driven wonder is present during a LOAD. 


disk failures started circulating. Here's why. 






10 fern save "0;key word pet,bas",8 


Every sector on a disk starts with a ' 'synchronizing character", a 


100 rem •* rte/S4- auto keyword for the pet/cbm 


Header b ock, another sync character, and then the data stored in that 


110 for j = 634 to 774: read x: pokej,x: ch = ch + x: next 


sector. 'Thysjcaily" it looks something ike: 


120 if Choi 7758 then print" checksum error": end 




130 print ■'sys(634): rem *• to enable ': end 


(.,» = sync HHH = Header DDD = Dala) 


140 data 165, 145, 201, 2,240, 20,165,144 




150 data 141, 5, 3.165,145,141, 6, 3 


4040: HHHHH DDDDDDDDDDDDDD 


160data120, 169, 149, 133, 144, 169, 2,133 


1541: HHHHH...DDDDDDDDDDDDDD 


170data145, 88, 96,165, 55,201.255,208 




ISOdala 90.165,217,201. 92,240, 87,201 


Notice how the second sync on a 1541 disk is shorter than on the 


190dala193, 48, 80,201,219, 16, 76, 56 


4040. Now you take a 4040 disk and write on it with a 1541. h 


200 data 233, 193, 170, 169, 27, 32,210,255 


becomes: 


210data169, 157, 32,210,255,169,178,133 




220data 87,169.176.133, 88,160, 0,132 


HHHHH...dddddddddddddddddd 


230 data 89,224. 0,240, 21,177, 87, 24 




240 data 42,176, 8,200,208,247,230, 88 


But that's OK - the 1541 and the 4040 can still cope. There is still 


250 data 76,199, 2,200,230, 89,228, 89 


enough of the sync and Ihe data block Is still the same "length". 


260data208, 235, 177, 87,133, 90, 36, 90 


However^ go back to the 4040 and write to the same sector and: 


270 data 48, 11, 32,210,255,200,208,242 




280 data 230, 88, 76,220, 2, 56,233,128 


HHHHH„.dddDDDDDDDDDDDDDD 


290data 32,210,255,108, 5, 3,173, 5 




GOOdata 3, 133, 144, 173, 6, 3, 133, 145 


Blammo! The data block starts with residue data from the 1541 write 


310 data 108, 5, 3, 0, 


to the second sync character. The data block is now "too long*' and the 




disk returns Read Error 23: Checksum Error in Data Block 


10 rem save "0: keyword c64,bas',8 




100 rem •* rte/84 - aulo keyword for the commodore 64 


Apparently new 154rs (as of July 84) have been modified to allow 


1 1 for j = 828 to 970; read x: poke j,x; ch = ch + x: next 


write compatibility between all 1541 and 4040 disketies. 


120 if Choi 7162 then print "checksum error': end 




130 print ■sys(828): rem •• to enable": end 




140data173, 21, 3,201, 3,240, 24,173 


Auto Key>vord5 For The VIC, C64, PET, and CBM 


150data 20, 3,141,201, 3,173, 21, 3 




160data141,202, 3,120,169, 92,141, 20 


Today we have the contender for the "two liner' of the year contest. 


170 data 3.169, 3,141, 21, 3, 88, 96 


This machine language monster consumes less than the equivalent of 


180data165, 58,201,255,208, 85,165,215 


two lines of BASIC, it sits in the cassette buffer and will reconfigure 


190data201, 169,240, 82,201,193, 48, 75 


every (shifted) letter on your keyword to produce a keyword. It's IRQ 


200 data 201, 219, 16, 71, 56,233,193,170 


driven, but retains the old IRQ to jump through at the end, so if IRQ 


210 data 169, 20, 32,210,255,169,158,133 


driven code is already installed, this program won't bother it. The 


220data 87,169,160,133, 88,160. 0,132 


code also operates in direct mode only, which most can appreciate if 


230 data 89,224, 0,240, 21,177, 87, 24 


INPUT statements are used in your program. And, if it comes down to 


240 data 42,176, 8,200,208,247,230, 88 


it, the " \ " key on the PET/CBM or the (shifted) pound symbol on the 


250 data 76,137, 3,200,230, 89,228, 89 


C64/V1C will reset the original IRQ and kill the routine. 


260data208, 235, 177, 87,133, 90, 36, 90 




270 data 48, 11, 32,210,255,200,208,242 


Now, considering that there are only 26 letters on the keyboard, how 


280 data 230, 88, 76,158, 3, 56,233.128 


^ are all the keywords accessed? With the VIC and C64 we have 76 


290data 32,210,255,108,201, 3.173,201 


1 keywords in total, and with the PET/CBM models with BASIC 4.0 we 


300data 3,141, 20, 3,173,202, 3,141 


1 have9L To battle this problem, a memory location within the routine 


310data 21, 3, 108,201, 3. 0. 


1 can be altered to supply you with every keyword- This location 




defines a "window" over Ihe total set of keywords. You can't get access 


VIC users need only make one change, Ttie number 160 in bold 


lo a)! the keywords simultaneously, but you can move the 26 keyword 


becomes a 1 92 (Also add 32 to the checksum just tor completeness} 



Tti« l^aniactor 



Volumes, l»u«06 



Letters 



Upgrades and Info: 1) [ have seen references to DOS 2.7 for the 
4040. How does this differ from olher DOS's? In particular, is there any 
point in me taking my old 2040 drive which has been upgraded with 
ROMs and new 6530 to DOS 2, and burning a set of ROMs (or even 
purchasing ihem, if ihey exist) to give me an upgraded-agaln disk 
drive? For instance, one of the things that I dislike about my present 
DOS 2 is that LOAD ' filename " ,8 starts both drives going, and waits 
until the wrong drive doesn't find the program before it sends out the 
program if did find on the right drive. So the questions are; Is there 
really a DOS 2,7 for the 4040? If so. can I upgrade? What's involved: 
new ROMs? New 6530? Minor or major board surgery? How can I get 
any chips or the code to burn my own? 

2) A lot of people locally seem to be getting the B-128 package from 
Protecto. I am already getting calls about do [ know this or that about 
it. 1 have heard that Commodore, while no longer producing B-128's, 
has not finished either. Do you have any idea of what may be 
available about the B-series machines in other countries, say England 
or Germany, or contacts from whom 1 could find out? I would dearly 
like a PRM and schematics; my German and Swedish are fluent 
enough so that information in those languages is perfectly fine for me, 
and even French would be OK in the absence of anything else. 

Charles McCarthy. 1359 W. Idaho Avenue, St, Paul MN 55108 

Pretty terrific questions, with some not so terrific answers. First, the 
DOSqueslion. 

As far as we know, DOS 2. 7 is currently available for tfie 8250 and 
8050 disk drives only. The problem with the DOS going to the currently 
unused or wrong drive first is sfill a problem, ft even seems worse with 
the 8250. Instead of politely determining that an empty drive is not in 
use, (he DOS fires a couple ofBVMPs onto the job que in (what seems) 
a last-ditch effort to avoid the occupied drive. Once ail the noise and 
vibration dies down, it goes to the correct drive. Once this routine has 
been suffered once, the DOS is bright enough to realise there is no disk 
inserted, and won t try it again. 

One major improvement with DOS 2. 7 makes this bearable though - 
Relative file length has been extended to the maximum capacity of a 
diskette (8050 or 8250). The otd limit was I80K. Since 4040 drives only 
hold I70K, even if an upgrade kit is available, this improvement 
makes a total upgrade somewhat less than worthwhile. 

Only one olher noticeable difference worth mentioning - An extended 
error message is also generated, with one extra digit at the end to 
inform you of what drive has been generating the message. This is 
alright at times, but is really aggravating when it comes time to use a 
program such as Fetspeed. Petspeed errs out due to the length of the 
error message The extra length means an error to Petspeed. so the 
program always gets upset and resets. No fun. Otherwise, DOS 2.7 is a 
pleasure, and might be worth your lime if you have an 8050 and need 
longer REL files. 

Next, on to question number two. The B series package has sure 
developed a lot of activity in North America, if the volum e of mail and 
the calls we^e getting is any indication. $900 US for the B machine. 
8050 drive, 4023 printer, green phosphor monitor, and a few diskettes 



toboot, who could go wrong. You could literally buy the system for the 
drive alone, and have all these extra goodies as a bonus. One 
problem. Very little documentation available. 

In Canada, Commodore was pretty good to the software developers 
before the computer was officially released. Everyone of any impor- 
tance got a B machine sent to them for software development. Some of 
the better packages were converted, but were shelved due to the non- 
release of the machine in Canada. Now, with Commodore releasing 
their entire stock of the B on Protecto, plus some more extra stock to 
make il more attractive, the B is alive again, but only in the USA. We 
know the machine to be pretty good, once you get used to the bank 
switching and playing about with the stack, etc. But there is really little 
available about it. We published Mm Butterfield's B Series ROM maps 
back in our reference issue in November 1983, and we are again 
publishing the maps in our reference book (The Complete Commo- 
dore Inner Space Anthology), but that seems to be the extent of high 
level info. A few magazine articles have appeared in TORPET, TPUG 
magazine. Computet, and of course. The Transactor, but again, it 
doesn 'I really add up to a hill of paper 

If anyone reading has some special knowledge on the subject, from 
any comer of the globe, please send it in to us. For all the program- 
mers here in good old Canada, maybe it's time to retrieve a few 
wasted dollars by releasing your creations. Let us know, and we'll 
pass it on. To start the ball rolling, heres a tip from Dave Berman, of 
Weston. Ontario. Place a (ros) 'c' within quotes in a REM line in your 
BASIC program, and your program will automatically DLOAD and 
RUN the first program on disk when listed to the screen - one way to 
discourage code peekers. That^s the first B bit, your letters will supply 
us with more. 



Clearly Inflexible: 1 have written a good program in which I have a 
heading that must remain on the top 3 lines of the screen at all times. 

This heading is used to print the different functions of the program, 
just like a word processor. These functions are written by poking the 
letter's screen display codes in the screen memory {from 1024 to 1 1 44) 
for the 3 lines. 

The problem is that in the program, at some times, I have to clear the 
screen without erasing the heading- The only way that 1 have found is 
poking the value of the space character (chr$(32)) in each of the screen 
addresses remaining, ie. from 1045 to 2023. However, this is awfully 
slow. Is there a way to accelerate that function. I have looked in a few 
books to find a way to {:ontrol the clear screen, but without any 
solution. 

There are a number of ways that this task can be completed. The first 
is to write a simple IRQ controlled routine to constantly refresh the top 
three lines hvm a data location somewhere else in memory. All that 
would be required of you is to POKE the correct display lines into this 
memory address, and the IRQ would transfer the display for you. Ifa 
clear screen is executed, the IRQ would only allow the screen to 
remain clear for a maximum of 1/60 of a second. A clean way to cure 
the problem. 



\ HwTVonioctor 



Volume S, If f u# 06 



A second method Is to wrile a simple clear screen routine in assem- 
bler, Ihat starts at the fourth line on the screen. When a clear screen is 
required, SYS to the start address of the routine and let it do a partial 
dean. 

For yoLi, the routines below have been prepared. Each are written in 
PAL format, but the op codes are standard MOS syntax, so any mini- 
assembler would probably work for you. 



Protection Reflection: In response to your Transactor issue dealing 
with the implementation of various types of protection schemes, one 
particular form that I have recently heard of was unmentioned. This 
has to do with the accessibility of more than the standard 1541 35 
track capabilities. I have been told by a few people that the 1541 along 
with the C64 is capable of formatting and using more than 35 tracks, 
but that Commodore didn't let anyone in on the big secret of how to go 
about this. 



100 
105 

no 

115 
120 
125 
130 
135 
140 
145 
150 
155 
160 
165 
170 
175 
180 
185 
190 
200 
205 
210 
215 
220 
225 
230 
235 
240 
245 
250 
255 



;•• irq driven display rout^ne •* 

h 

* = 828 ;startaddr can be anywhere convenient 



irqvec = $0314 
screen = 1024 



;irq vector in ram 
;start of screen 



sei 

Ida irqvec ; sta oldirq ;retain old irq vector 

Ida ifqvGC + 1 : sta oldirq + 1 

Ida #<start: sta irqvec ; point new irq vector at code 

Ida #>start: sla irqvec + 1 

cli: rts 

start = ' 

Idx #0 



loop = • 

" ^ 
f 

Idadata.x 
sta scree n,x 
inx: cpx#120 

bne loop 

jmp (oldirq) 

p 

oldirq worO 
data - * 
.end 



get the display data 

store it on the screen 

only allow 3 lines (3 X 40 = 120) 



;two bytes storage for old irq vector 
istore the display lines from here on 



I am very curious about this daimed ability and would very much like 
to know how this can (or can't) be done. Also, could you possibly tell 
me where I could find out other little secrets about the 1541 (like the 
ones you mention in your Nov. issue) or is the only way to learn these 
by experimentation? Ryan Briegal, M.S.U.. E. Lansing, Ml. 

The 1541. along with the 2031 and 4040 drives, are capable of moving 
their stepper motors in half steps, thus increasing iheir capacity to 70 
tracks, in relation to the normal 35. However, they cannot be expected 
to accurately read and write in this manner At limes it would work, at 
others it might not. So what at first might seem like a design oversight 
Is in fact quite intentional. To get higher capacity with reliability, you 
need more accurate motors which cost more money. 

To dale, numerous protection schemes have been designed that make 
full use of the half step capability of (he drive. A portion of the diskette 
is formatted in this rather obtuse manner, either a half step out hvm a 
normal diskette, thus writing and reading in a special way. or the 
balance of the diskette is hotf stepped right across, and data is stored 
between the normal tracks. As long as the data stored in between is 
not required for anything more than a check of protection, and the 
program realizes that it may take a few tries to get the info, then the 
technique is ok. Us your choice if you want to start drive stepping, but 
get ready for some pretty heavy duty programming. 

For more fads and info, there is a really good book on the subject. The 
name is 'Inside Commodore DOS', written by Richard Immers and 
Gerald G. Neufeld. published by: Datamost, 20660 Nordhoff Street, 
Chatsworth. CA, 91311-6152 (818) 709-1202, ISBN 0-88190-366- 
3. Forme, this book is to the drive as Raeto Collin West's book is to the 
computer: a pure and applied source knowledge. 



300 ;•' routine to clear all but the top 3 lines of the screen •" 

305; 

310'=^ 828 ;start addr can be anywhere convenient 

315; 

320 screen = 1144 ;new screen start address for clear 

325; 

330 Idx #0: Ida #32 

335; 

340 loop = • 



; (space) 



;l0Qp to clear 3 pages of screen mem- 
ory past ttie top 3 lines 

345; 

350stascreen,x : sta screen + 256,x ; sta screen + 51 2, x 

365 inx ; bne loop 

370; 

375 final = • 

380; 

385 sla screen + 768.x ;finat clear of the bottom 

390 inx, cpx#112 ibalance of screen to clear 

395 bne final 

400 rts 

405; 

410. end 



Unimplemented Inquiry: In the Transactor of January 1985 
(pg.22), \ was surprised to learn that most 65xx CPUs have operations 
that can be executed but are not officially part of the instruction set. 
Where would I find more information {definition and machine code)? 

Richard Pitre, Montreal, Quebec 

For some reatly good info on the pseudo-ops that MOS won't talk 
about, there are two pretty good sources. Raeto Collin West 's Pro- 
gramming The PET/CBM' has on in depth article on the subject on 
pages 488 and 489. In his usual thorough style, Mr. West lists the 
codes, their functions, and a few paragraphs relating some experi- 
ences. To further compliment your quest for knowledge, you could try 
the Octotter 1 983 Issue (Issue 41) of Compute! Magazine, on pages 261 
through 264. The article 'Extra Instructions^ written by Joel C. Shep- 
herd, has been written with a pro-use attitude. However, there are 
those that have less than total faith in the extra codes (Jim Butterfield 
for one). Further. MOS knows they exist, but neglect to document 
them. From a market standpoint it would have been to their advan- 
tage to include the extra instructions in their command set, but they 
didnt trust them enough to do so. Heed these words of warning before 
ever considering writing code with the unofficial pseudo-ops in place, 
ff the people who designed the chips don 'I trust them, why shouid you? 



Th« Trantoctor 



10 



Volume 5, 1»U9 06 



Introducing "VERIFIZER" 



The Transactor's New Foolproof Program Entry Method 



The greatest source of calls and letters we get at the Transactor are 
from people who are having difficulty getting a long program from the 
magazine to work right. Occasionally it's due to a goof-up on our part, 
but other times it's simply because the chances of making a typing 
error in a very long program are quite large, and finding that error 
(probably more than one) after the entire program has been entered is 
quite difficult. This is especially true for machine language programs 
in BASIC loader form, where the hundreds of numbers in the DATA 
statements can make the most competent reader go cross-eyed. 

To save you from endless program de-glitching sessions, weVe come 
up with two solutions. The first is the best, but it'll cost you: All 
programs printed in the magazine are also available on disk, includ- 
ing those from past issues (see the center insert in this issue for more 
details). 

The second solution doesn't save you any typing, but it can help you 
find errors as soon as you make them. The solution comes in the form 
of a short machine language program called ^'VERIFIZER" — so 
named, of course, because it verifies! (OK, so we indulged in a cute 
name — no nasty letters from English teachers, please,) VERIFIZER 
should be run before typing in any long program from the pages of 
The Transactor. From this issue onwards, all long programs will have 
two uppercase letters printed before each line. The programs should 
be entered normally (i.e. don't enter the letters in front of the line), but 
every time you enter a line, VERIFIZER will print two characters at the 
top left of the screen. If these letters match those in print, you entered 
the line properly. 

Besides catching omissions and other blatant errors in each program 
line, VERIFIZER will also catch transpositions; probably the most 
commonly made error with numbers in PEEK, POKE, or DATA 
statements. For example, if you're typing quickly and enter 52381 
instead of 53281, VERIFIZER will catch the error and report a code 
different from the one printed with the program listing. To make your 
life easier though, there are some variances that VERIFIZER will NOT 
catch. One is that it ignores spaces — you can put as many spaces as 
you want between keywords, or leave them out altogether without 
changing the reported code. Spaces are accepted anywhere as long as 
they don't split up keywords. Keep in mind, though, that there may be 
occasions where the number of spaces Is important (eg. in a string 
definition), so take notice of messages such as [9 spaces] in a listing - 
which means, naturally, enter 9 spaces, not the number 9 followed by 
the word 'spaces'. Another thing you can get away with is the 
abbreviation of keywords. Since VERIFIZER looks at token values, 
you will get the same result if you type 'nE' or 'next\ 

How to use VERIFIZER 

Listing 1 contains two verslonsoftheVERlFlZER program; one for the 
PET, and one for theC64 or VIC. These listings will appear in all issues 
from now on. You'll notice that the verifizer listings are themselves 
printed in "verifized" format (with the report codes along the left side), 
which seems pretty silly, since you won't have verifizer while you're 
typing the program in. The codes are there just as a check, so that 
once verifizer is up and running you can press RETURN over some 
program lines and see if the reported codes match up with those 
printed with the listing. 



Enter the applicable program and RUN it. If you get the message, 
■'*i,*-*dalaerror ***•'", re-check theprogram and keep trying until 

all goes well. You should SAVE the program, since you'll want to use it 

every time you enter one of our programs. Once you've RUN the 

loader, enter NEW, then turn VERIFIZER on with: 

SYS 828 to enable the C64/VIC version (turn it off with SYS 831) 
or SYS 634 to enable the PET version (turn it off with SYS 637) 

Once VERIFIZER is on, every time you press RETURN the two-letter 
report code will appear in the first two screen locations In reverse 
field. Note that these letters are in uppercase and will appear as 
graphics characters unless you are in upper/lowercase mode (press 
shift/Commodore on C64/VIC). \i you press RETURN on a screen hne 
that doesn't contain a BASIC program line (i,e, no line number at the 
beginning), the code you'll gel is unpredictable — VERIFIZER is only 
used to report on BASIC program lines. 

With VERIFIZER on, just enter the program from the magazine 
normally, checking each report code after you press RETURN op a 
line. If the code doesn't match up, you can re-check and correct the 
line, then try again. If you wish, you can LIST a range of lines, then 
type RETURN over each in succession while checking the report 
codes as they appear. If you're in the habit of re-numbering segments 
ofaprogramasyou type it in, be prepared for unmatched codes, since 
VERIFIZER uses the line number as part of its checksum calculation. 
Once the program has been properly entered, be sure to turn VERIFI- 
ZER off with the sys indicated above before you do anything else, 

VERIFIZER resides in the cassette buffer, so if you're using a datasetle 
be aware that tape operations can be dangerous to its heahh. As far as 
compatibility with other utilities goes, VERIFIZER shouldn't cause any 
problems since it works through the BASIC warm-start link and 
jumps to the original destination of the link after it's finished. When 
disabled, it restores the link to its original contents. 



How VERIFIZER Verifies 

VERIFIZER generates the report code on a checksum principal, but 
assigns "weights" to each byte to catch transposition errors- The 
weights 1 ,2,3,4 are assigned to the tokenised BASIC line, and the low 
byte of the line number is added in. In other words, a checksum is 
obtained by taking the line number low byte, adding I times the first 
byte in the BASIC line (from the BASIC input buffer at $0200), 2 times 
the second, 3 times the third. 4 times the fourth, then 1 times the fifth, 
etc. The final checksum is a two byte unsigned integer. The high byte 
is discarded, and the low and high nybbles of the low byte are used to 
form the two report code characters, which are put directly into screen 
memory in the PET version, and PRlNTed to the screen with the VIC/ 

C64 version. 

Since only the low byte is used, checksum variances of exact multiples 
of 256 will not be detected, but the probability of that occurring as a 
legitimate error was judged to be reasonably small. For example, if 
you "accidentally" entered the line number 1256 instead of 1000, 
there would be no discrepancy in the report codes. However, if you're 
that uncoordinated, don't even try to type in programs — get the disk. 



Th# 'h'onsactor 



11 



Volume S, l»u« 06 



VERIGEN: VEiUFIZER program generator 



Listing lb: PET/CBM VEIUFIZER (BASIC 2.0 or 4.0) 



On the other side of Ihe VERIFIZER slory, there is VERIGEN to create a 
verifized sequential file from a program. The version we use includes 
special control characters in the output file for the typesetter, but the 
version shown here (listing 2) jusi creates a sequential file giving the 
program listing with line numbers separated from the verifizer codes 
by a single space. 

What good is VERIGEN to you? Well, if you have a printer and like 
storing program listings as a final backup, you may want to have them 
in verifized form should the day ever come when every one of your 
disks inslantly turns to electro-dust. Or if you have a 64 with a 1541 
drive and want to give a program to a PET owner who has an 8050, 
you can give him a verifized listing (assuming, of course, that he has a 
copy of VERIFIZER). 



How to use VERIGEN 

VERIGEN runs on a C64 and works with two disk files, "infil" and 
"outfil". Before executing Verigen, the program to be verifized must 
be in memory, AND a listing of that program must be on disk as a 
sequential file named '1nfir'. To create infil, just enter the following 
after the input program for Verigen is in memory: 

open8,8,8, ' @0;infil,s,w ' : cmd8: lisl 
print#8; closel 

After "infil" has been set up in this way, just sys49152 to execute 
Verigen. It will create "outfil" for you, which will be a sequential disk 
file containing the program listing with verifizer codes before the line 
numbers, Outfi! can be sent to a printer or manipulated like any 
sequential text file (i.e. loaded into a word processor). 



VERIFIZER wilt make pretty sure that the program you type in mimics 
that in the listing, but it can't guarantee that the listed program is bug- 
free. So if VERIFIZER says a program is OK and if still doesn't work, 
youcandropusalinewithoutworrying that the problem may be with 

your typing. 



Listing la: VERIFIZER for C64 and VIC20 



KE 

JF 

LI 

BE 

DH 

GK 

FH 

KP 

AF 

IN 

EC 

EP 

OC 

MN 

MG 

DM 

CA 

NG 

OK 

AN 

GH 

JC 

EP 

MH 

BH 



10 rem- data loader for 'verifizer' • 

15 rem vic/64 version 

20cs = 

30 for i = 828 to 95e:read a:poke i,a 

40cs = cs + a:nexti 

50: 

60if csOl 4755 then print ■•'••• data error * 

70remsys828 
80 end 
100: 

1000 data 76. 74, 
1010 data 252. 141, 
1020 data 3,240, 
1030 data 251, 169, 
1040 data 3, 3, 
1050 data 0,160. 
1060 data 32,240, 



*i#** 



: end 



2, 
3, 
2, 



3,165,251,141, 

3, 3, 96,173, 

17,133,252,173. 

99,141, 2, 3,169, 

96,173,254, -1,133, 

0.189. 0, 2,240, 

15,133, 91,200,152, 

3, 198, 90, 

32, 240, 255, 

18, 32,210, 



32, 183, 



1070data133, 90, 
1080 data 232, 208,229, 56, 
1090 data 32,210,255,169, 
llOOdala 89, 41, 15, 24, 105, 
1110dala165, 89. 74, 74, 74, 
1120data 32, 210,255, 169j 146, 
1130 data 32,240,255,108.251, 
1140data101, 89, 133, 89, 96 



97, 32, 

74, 24, 

32,210, 

0, 165, 



3,165 

3,201 

3,133 

3, 141 

89, 162 

22, 201 

41, 3 

16, 249 

169, 19 

255, 165 

210,255 

105, 97 

255, 24 

91, 24 



CI 
CF 
LI 
HC 
DH 
GK 
OG 
JO 
AF 
IN 
ON 
IB 
CK 
EB 
HE 
01 
JB 
PA 
HE 
EL 
LA 
Kl 
EB 
DM 



PI 
LN 

LI 
PE 
DH 

GK 

KH 

El 

AF 

IN 

EP 

AE 

KP 

JB 

NG 

iB 

IF 

OF 

GJ 

HB 

OA 

IG 

MD 

CJ 

Al 

KF 

AO 

MJ 

CL 

FD 

PL 

Al 

Kl 

LO 

FO 

LA 

HE 

AF 

LM 



10 rem* data loader for "venfi^erA.O" • 

15 rem pet version 

20cs = 

30 lor i = 634 to 754:read a:poke i,a 

40cs = cs + a:nexti 

50: 

60 if csOl 5580 Itien print '••••• data error »*•*• 

70 rem sys 634 

80 end 

100: 

1000 data 76,138, 2,120,173,163, 2,133, 

1010 data 173, 164, 2,133,145, 88, 96,120, 

1020data145, 201, 2,240. 16,141,164, 2, 

1030 data 144, 141,163. 2,169, 165.133, 144, 

1040 data 2,133.145. 88, 96, 85,228,165, 

1050data201, 13,208, 62,165,167,208, 58, 

1 060 data 254, 1 , 1 33, 251 , 162, 0. 1 34, 253, 

1070data 0, 2.168.201. 32,240, 15,230, 

1080data165,253, 41. 3.133,254, 32,236, 

1090 data 198, 254, 16,249,232, 152,208,229, 

1100data251, 41, 15, 24,105,193,141, 0, 

1110data165,251, 74, 74. 74, 74, 24,105, 

1 120 data 141 , 1 , 128. 108, 163, 2. 152, 24, 

1130data251, 133,251. 96 



: end 



144 
165 
165 
169 
217 
173 
189 
253 
2 
165 
128 
193 
101 



LisHng 2: VERIGEN 

10 rem* data loader for "verigen" * 

15 rem runsonc64 

20cs = 

30 for i = 491 52 to 49410:read a:poke i,a 

40cs = cs + a:next i 

50: 

60 if cs<>36235ttienprint "♦•••• data error *♦••* 
70 rem sys 49152 
80 end 
100: 

1000data169, 1,162, 8,160, 12, 32.186, 
1010data169, 11,162,235,160,192, 32,189, 
1020 data 32,192,255, 32,183,255,240, 1. 
1030 data 169, 2,162, 8,160, 13, 32,186, 
1040data169. 13,162,246,160,192, 32,189, 
lOSOdata 32.192,255, 32,183,255,240, 1, 
1060 data 165. 43,133,254,165, 44,133,255, 
1070 data 0,162, 1, 32,198,255, 32,228, 
1080 data 32,228,255,177,254,208, 12,200, 
1090 data 2, 230, 255, 177, 254, 208, 8, 76, 
1 1 00 data 1 92, 200, 208, 2, 230, 255, 200, 208, 
1110 data 230, 255, 1 77, 254, 133. 251 , 200. 208, 
1120 data 230, 255, 200, 208, 2, 230, 255, 169, 
1 130 data 133, 252, 1 77. 254, 1 70, 201 , 32, 240, 
1 140 data230, 252. 165, 252, 41 , 3, 133, 253, 
1 1 50 data 228, 192, 1 98, 253, 1 6, 249, 200, 208. 
1 1 60 data 230, 255, 1 38, 208, 226, 162, 2, 32, 
1170data255, 165,251, 41, 15, 24,105,193, 
1180data210,255, 165,251, 74, 74, 74, 74, 
1190 data 105, 193, 32,210,255,169, 32, 32, 
1200data255, 162, 1, 32,198,255, 32,228, 
1210data 72, 32,183,255,201, 0,208, 16, 
1220 data 2, 32,201,255,104, 32,210,255, 
1230 data 13,208,227, 76, 75.192,104, 32, 
1240data255, 169, 1, 32, 195,255, 169, 2, 
1250 data 195, 255, 96,138, 24,101,251,133, 
1260 data 96, 46, 58. 73, 78, 70, 73, 76, 
1270 data 83, 44, 82, 64, 48, 58, 79, 85, 
1280 data 70, 73, 76, 44, 83, 44, 87 



: end 



255 

255 

96 

255 

255 

96 

160 

255 

208 

214 

2 

2 



15 

32 

2 

201 

32 

24 

210 

255 

162 

201 

204 

32 

251 

44 

84 



Th* IVanfacter 



13 



^lum* 5, Imu* 06 



The MANAGER Column 



Don Bell 
Scotland, Ontario 



Letters to the Manager 

This issue's application is a HOME BUDGETING PROGRAM. But first, 
let me respond to some letters that express common concerns. 

VERSIONS: First off, make sure you have version 1.06 of THE 
MANAGER. Otherwise, you will be fighting some bugs in the L04 
version. I regret that i cannot help you acquire an updated version 
other than suggesting you return to your dealer or bug Commodore. 
My regrets to David Huston of Saanichton, B.C. I hope this solves 
Harry Hirashima's (Ballerica MA) problem, 

DISK DRIVES: THE MANAGER was only designed to run on one 
1541 disk drive. Hence you cannot hook up 2 disk drives or use a 
4040 disk drive. My condolences to Chris Mante of New York and 
Keith Adams of Mississauga, Ontario. 

MORE INFORMATION ON THE MANAGER: At this time there 
are no plans to issue new documentation, a book or a compilation oi 
previous articles. Unfortunately, 1 do not have the time to photocopy 
individual articles for people. Slay tuned to the Transactor though, 
things may change. My apologies to James Bridgewater of San Berna- 
dino CA„ David Shields of Gainesville Florida, J.F. O'Neil of Miami. 
Eva Gray of Galion OH. Lome Cooke of Rose Blanche, Newfoundland. 

Editor's Note: Commodore may be planning a re-release of the 64 
Manager. A new manual would accompany the package but ! have 
no official word on the subject. As Don says. . . "Stay tuned". 

REPORT GENERATE & ARITHMETIC: Having problems with 
Report Generate or Arithmetic? In future articles I will repeat some of 
the in-depth instructions I gave on how to use these options but 
within the context of new applications. 

PRINTING PROBLEMS: I'm afraid I can't help you much with 
printer problems, 1 am only familiar with the 1526 Commodore 
printer which I am using. Also, there is no way ot speeding up/ 
compiling the printing part of the program that 1 am aware of. 

SEARCH FUNCTION; The Search Function does not support While 
loops. However, there is a way around this problem. If you want to 
check many different fields for the same item, simply use the OR 
statement to string together a number of different possibilities. You are 
not limited to I line only. In a previous article I described how a police 
department could use the search function on a stolen goods file to pair 
up goods recovered with goods stolen. Using the complex search 
criteria (F5)-Fl='0BJECr OR F2 = '0BJECT' OR F3 = '0BJECT'. . .it 
is possible to look for the object in many different fields. This is for Jim 
Rendant of Chicago. 

CHANGING SCREENS: How do you gel from one screen to the next 
in Enter/Edit asks Mrs. N. A. Doninger of Huntington Beach CA. F7 
for next screen (page). F8 for previous screen (page). 

SCRATCHING A DATA FILE: In the Manipulate Files option there 
is a function called 'Scratch a Data File". This is used to remove 
unwanted files from a diskette. The manual is wrong here- The 
prompt on your screen is 'ERASE THE MATH, DATA OR INDEX 
FILES' not 'ERASE THE MATH, DATA OR BOTH FILES'. Sometimes 
you may want to keep the data file itself with its screens, but erase the 
math or index files so that you can create new ones. This option 
allows you to do that. When entering the name of the file to scratch 
enter the normal filename, DO NOT include prefix characters such as 
DA., PT. etc. If you enter a filename that is not on the disk, the 
program will appear to erase the file anyway. The only verification 



that it has been erased is that it no longer appears on the disk 
directory. I had no problem getting this function to work in versions 
1.04 and 1.06. If you are having trouble with this function, you can 
always 'kill' THE MANAGER (by powering down) and perform file 
deletions in BASiO If you want to erase all the files associated with 
your data base file use this command; 

open 1 5,8,1 5:prinl#1 5, " sO:??filename* " :c1osg 1 5. 

The '??.' will accept all 2 letter prefixes to the filename(rf- pt. sc. etc.} 
and the * will accept any characters after the filename. THE MAN- 
AGER makes all filenames 16 characters long by adding blank spaces 
to the end of the filename. Thus, In this case, the '*' means that any 
number of blank characters following the filename will be acceptable. 

1 hope this satisfies Chester Freeman of New Rochelle, N.Y. 

REPORTS FOR YOUR WORDPROCESSOR: Outputting Reports 
to Disk For Use in a Wordprocessor can be very useful. I had success 
outputting a mailing list to disk for use in the 'Paperclip' wordproces- 
sor. The report was outpulted to disk as a sequential file and then thai 
file was loaded into the wordprocessor as a sequential file. As 1 do not 
have other word processors, 1 cannot help you much in this regard. It's 
the type of thing you have to experiment with yourself. Good luck to 
Teri & Denis Hickethier of the Commodore Computer Users Group in 
Heidelberg, Germany, Michael Tesch of West Chicago, 

FILE SIZE: Some users have expressed dismay at the fact that they 
cannot attain the maximum advertised limit of THE MANAGER, i.e. 
2000 records. This is only a MAXIMUM! . The problem is not THE 
MANAGER, it is the limited capacity of the disk drive and diskette. If 
your records are reasonably small - no problem creating a file of 2000 
records. However, as your records get larger they eat up more bytes on 
the diskette and you cannot have as many records. You may also need 
room on the disk for your arithmetic and report files. Report files don't 
have to be on the same disk, but it's easier U they are. For example, 
using one screen, the maximum record length 1 could use to create 
2000 records was 78 characters. For a 100 character record length 1 
can only create 1 563 records. For a 200 character record length using 

2 screens I could only create 780 records. For a 300 character record 
length 1 could only create 518 records. As a rule of thumb, to calculate 
the approximate number of records, divide 156,000 by the length of 
the record. Remember the '64 is basically a home computer, not a 
business machine. If you're trying to do a business application 
requiring a lot of records, you might need a more powerful and 
expensive computer system. My thanks to Frank Hancock 111 of 
Houston Texas and his church membership application for bringing 
this problem to my attention. 

Hugh Greenwood of Vancouver, B.C. is using a MANAGER file to keep 
track of his slide collection. It has grown so large that he needs 2 files. 
He now wants to create a 3rd file which will act as an index for all of 
the slides in the other 2 files. He was hoping to use the Rearrange a 
File function in the MANIPULATE FILES option to move information 
from one file to another. The problem he is having is that he can only 
move information to his new fiie from one of the old files, not both of 
them. Also, he does not know of a way to use THE MANAGER to 
concatenate 2 small files. Unfortunately, 1 can't think of a way to solve 
his problem either. If anyone out there has a solution to his problem, 
please let me know. My only thought is a solution outside of THE 
MANAGER program. First, make 2 reports outpuUing the selected 
fields from the 2 slide files to disk as sequential files. Then write a 
BASIC program to concatenate the 2 sequential files. Then either use a 
wordprocessor or write a BASIC program to read the files, sort and 
printout whatever is required. This might be more trouble then re- 
entering half the data! 



Th« IbvrtMictor 



13 



Volumv 5, liiuft 06 



A Home Budgeting Application 

Ever wonder where all your money goes? Ever discover too late you're 
in a cash flow bind thai you should have seen coming? Ever want to 
make a serious attempt at saving some money for a change? Ever 
make some New Year's economic resolutions? Read on McDuff. IVe 
got just the application for ail you penny pinchers, spendaholics, 
budgeteers, and money maniacs! Yes, you too can be in control of 
your economic fate. . . or at least, predict it! 

The purpose of this application is to help you plan your budget a year 
a( a time and smooth oul some of your cash problems. The real value 
oJ fhis application to you will be determined not so much by the 
design of the application itself, but by your using its structure to force 
yourself to think about your budget and plan ahead. 

Even if you don't want to use this application, you can derive several 
benefits from analyzing its construction. 

Many applications cry out for a combination of the benefits of a 
database and a spreadsheet. One of the best little functions in THE 
MANAGER is the ability to do 'what if calculations just like a 
spreadsheet. This Junction is available in the Enter/Edit mode using 
the ' = ' key. This application makes extensive use of this feature to 
help you decide what you can afford to spend in various budget 
categories. This feature combined with the 'accumulate' function 
gives you an incredibly powerful budgeting tool. You can peer into 
your distant economic future, plan for it and change it when neces- 
sary. 

1 know some of you dread using Report Generate. You'll be glad to 
know that this application does not use it. How did I get around it? 
Reports go directly to the screen using the display positions in 
Arithmetic. This is not to say that you cannot go ahead and do your 
own reports using Report Generate. 

Arithmetic! Boy have 1 got arithmetic for you. This application should 
give you some real insight into how to use the Arithmetic option to 
create a very powerful application. 

I hope this application generates as much enthusiasm in you as it did 
in me. After writing my own budget programs over the last few years, I 
was thrilled by being able to let THE MANAGER do most of the work 
for me this time, instead of wasting my time debugging code, 1 could 
instead concentrate on the real meat of the matter - the ideal design 
for the application itself. 

Screens for Home Budgeting 

Use the Create/Revise option to create 6 screens altogether. The first 3 
screens are for the current month's data about budget and actual 
amounts. The iast 3 screens are for year-to-dale amounts that will be 
computed by the 'accumulate* function. 

Don't feel any obligation to use my budget categories. Make up your 
own that suit your particular needs. For example, you may decide that 
foodout is unnecessary since it is really part of entertainment ex- 
penses. You might consider a category for bank charges, overdrafts 
and interest on credit card accounts. These charges are a waste of 
money and should be minimized. 

The only thing I do suggest is that you keep the same number of 
categories under each section (i.e. 3 for income, 8 for fixed expenses, 
and 15 for variable expenses) and you keep the categories and totals 
on the same lines of the screens. Ifyou don't follow these 2 rules then 
you'll have to modify my Arithmetic file -- change the display position 
definitions, the output of numeric data to display positions and the 
counter for loops. Only more advanced users should take on this 
challenge. 

Totals and the DIFF'CB column in all screens will be calculated by the 
Arithmetic file using display positions. 



All budget and actual amount fields are 7 characters long and 
numeric, the 2 fields under ^NOTES' are 40 characters long and 
always alphanumeric. 

Here's how to obtain screen printouts of field lengths and field 
numbers for your first 2 screens. Select the Enter/Edit option from the 
main menu, then make sure the screen is clear (if not, press Shift 
CLR/HOME). To display field lengths, press 'up arrow\ To display 
field numbers, press Shift 'up arrow'. Press 'p^ to gel a printout either 
screen. You will need these printouts of field lengths and field 
numbers to refer to when doing searches or designing reports. 

Screen 1 is used for entering budget and actual amounts for income 
and fixed expense categories. 







HOME BUDGET 


t t 






BUDGET 


ACTUAL 


DIFF'CE 




INCOME 














PAYCHECK 


t 


t 


t 


t 


(line 6) 




INTEREST 


t 


t 


t 


t 






OTHER 


t 


t 


t 


t 






TOTALS 














FIXED EXP. 














SAVINGS 










{line 12) 




RENT/MORT. 














UTILITIES 














PAYMENTS 














CLUB FEES 














PROP TAXES 














INSURANCE 










- 




LOANS 










flinel9) 




TOTALS 


















NOTES 








t 












t 


t 












t 


SCREEN I OF 6 















Screen 2 is used for entering budgeted and actual variable expenses. 



VARIABLE EXPENSES 



AUTO EXP. 

CHAR/CHURCH 

CLOTHING 

DENTAL/MED'L 

EDUCATION 

ENTERTAIN. 

FOODOUT 

GAS 

GROCERIES 

HOUSE MAINT 

PURCHASES 

RECREATION 

TRANSPORT'N 

VACATION 

OTHER 

TOTAL 



BUDGET ACTUAL DIFFCE 



(line 5) 



(line 20) 



NOTES 



t 
t 
SCREEN 2 OF 6 



t 
t 



Til* TranHictor 



14 



Volume 5, Ittue 06 



Screen 3 gives a summary statement that is calculated in the Arithme- 
tic file. 



NET INCOME 




BUDGET ACTUAL 


DIFPCE 




INCOME 




(line 5) 




EXPENSES 








FIXED 




Oine 8) 




VARIABLE 








NET INCOME 




(line 11} 






NOTES 






t 






t 


t 






t 


SCREEN 3 OF 6 









Screens 4 to 6 do not require any data to be entered. The note fields 
are there in case you wish to enter your observations about your 
spending habits to date. They act like report screens, simply display- 
ing the year-to-date cumulative results of the arithmetic acting on all 
Ihe month records in your file. 

Screen 4 is used to display yeaMo-date budget and actual amounts 
for income and fixed expense categories. Notice that it is similar to 
screen I with the exception of the dale field and totals. Using the 
'accumulate' function in Enter/Edit to execute the Arithmetic file 
several times will produce the year-lo-date numbers 



*• YEAR-TO-DATE INCOME/FIXED EXPENSES ** 






BUDGET ACTUAL 


DIFFCE 


INCOME 








PAYCHECK 




(line 6) 




INTEREST 








OTHER 








FIXED EXP, 








SAVINGS 




(line 12) 




RENT/MORT, 








UTILITIES 








PAYMENTS 








CLUB FEES 








PROP TAXES 








INSURANCE 








LOANS 




(line 19) 






NOTES 






t 






t 


t 






t 


SCREEN 4 OF 6 









Screen 5 is to display year-to-date budgeted and actual variable 
expenses. Again, this will be the result of using the 'accumulate' 
function in Enter/Edit mode. 



** YEAR-TO-DATE VARIABLE EXPENSES •• 



BUDGET ACTUAL 



AUTO EXP. 

CHAR/CHURCH 

CLOTHING 

DENTAL/MED'L 

EDUCATION 

ENTERTAIN. 

FOODOUT 

GAS 

GROCERIES 

HOUSE MAINT 

PURCHASES 

RECREATION 

TRANSPORTN 

VACATION 

OTHER 



DIFFCE 
(line 5) 



(line 19) 




Screen 6 gives a year-to-date summary income statement that is 
calculated in the Arithmetic file- 
In addition, a statement of budgeted and actual gross savings is 
calculated by adding year-to-date net income and year-to-date 
savings. Presumably, if your net income at some point is a negritivt* 
amount, then you will have to draw on your savings to cover the 
deficit. The amount of Gross Savings will show the effect of this. The 
purpose of this statement is to see how you are really doing in terms of 
saving money. It is also useful for predicting a cash flow bind at some 
time in the future. If Gross Savings is a negative amount then youVe 
going to have to borrow money from somewhere else or run up your 
credit cards- 



** YEAR-TO-DATE NET INCOME •• 



INCOME 

EXPENSES 
FIXED 
VARIABLE 

NET INCOME 



BUDGET ACTUAL DIFF'CE 

(line 5) 



{line 8) 



(lineH) 



GROSS SAVINGS (NET INCOME -f SAVINGS) (line 17) 



NOTES 



t 
t 
SCREEN 6 OF 6 



t 
t 



Th« Tronioctor 



15 



Volum* 5, l»u« 06 



Press the back arrow key lo store the screens. Remember to alter the 
amounl fields so they are numeric. 

DeHning the Screen Display Positions 
For the Arithmetic File 

Choose the Arithmetic Option from Itie main menu in THE MAN- 
AGER. 

First we will define the display positions on all 6 screens. Screen 1 is 
the current month's budgeted and actual income and fixed expenses. 
We will now define the display positions for the DIFFCE column and 
the totals line- 
Use the Return key to advance within a line. Use the back arrow key 
to advance lo the next line. 



42. 


LINE? 9 


COLUMN? 11 


LENGTH? 9 


43. 


LINE? 9 


COLUMN? 21 


LENGTH? 9 


44. 


LINE? 9 


COLUMN? 31 


LENGTH? 9 


45. 


LINE? 1 1 


COLUMN? 1 1 


LENGTH? 9 


46. 


LINE?!] 


COLUMN? 21 


LENGTH? 9 


47. 


LINE? 1 1 


COLUMN? 31 


LENGTH? 9 



Screen 4 is the year-to-date budgeted and actual income and lixed 
expenses. . We will now define the display positions for the BUDGET 
ACTUAL and DIFPCE columns. 



NO. 
1. 
2. 
3. 
4. 
5. 
6. 
7. 
8. 
9. 
10. 
11. 
12. 
13. 
14. 
15. 
16. 
17, 



OF DISPLAY POS'N ON SCREEN 1 ? 17 



LINE? 6 
LINE? 6 
LINE? 8 
LINE? 9 
LINE? 9 
LINE? 9 
LINE? 12 
LINE? 13 
LINE? 14 
UNE?6 
LINE? 6 
LINE? 17 
LINE? 18 
LINE? 19 
LINE? 20 
LINE? 20 
UNE? 20 



COLUMN? 31 
COLUMN? 3! 
COLUMN? 31 
COLUMN? 11 
C0LUMW21 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 17 
COLUMN? 31 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 
COLUMN? 31 



LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 



Screen 2 is the current month's budgeted and actual variable ex- 
penses. We will now define the display positions for the DiFF'CE 
column and the totals line. 



NO, 
18. 
19. 
20. 
21. 
22. 
23. 
24, 
25. 
26. 
27. 
28. 
29. 
30. 
31. 
32. 
33. 
34. 
35. 



OF DISPLAY POS'N ON SCREEN 2 ? 18 



LINE? 5 
LINE? 6 
LINE? 7 
LINE? 8 
LINE? 9 
LINE? 10 
LINE? 1 1 
LINE? 12 
LINE? 13 
UNE? 14 
LINE? 15 
LINE? 16 
LINE? 17 
LINE? 18 
UNE? 19 
UNE? 20 
LINE? 20 
UNE? 20 



COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 21 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 
COLUMN? 31 



LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 



NO. OF DISPLAY POS'N ON SCREEN 4 ? 33 


48, 


UNE? 6 


COLUMN? 1 1 


LENGTH? 9 


49, 


UNE? 6 


COLUMN? 21 


LENGTH? 9 


50, 


LINE? 6 


COLUMN? 31 


LENGTH? 9 


51, 


UNE? 7 


COLUMN? 1 1 


LENGTH? 9 


52. 


LINE? 7 


COLUMN? 21 


LENGTH? 9 


53. 


LINE? 7 


COLUMN? 31 


LENGTH? 9 


54, 


LINE? 8 


COLUMN? 1 1 


LENGTH? 9 


55, 


UNE? 8 


COLUMN? 21 


LENGTH? 9 


56. 


UNE? 8 


COLUMN? 31 


LENGTH? 9 


57. 


UNE? 12 


COLUMN? 1 1 


LENGTH? 9 


58. 


UNE? 12 


COLUMN? 21 


LENGTH? 9 


59. 


UNE? 12 


COLUMN? 31 


LENGTH? 9 


60. 


UNE? 13 


COLUMN? 11 


LENGTH? 9 


61. 


UNE? 13 


COLUMN? 2 1 


LENGTH? 9 


62. 


LINE? 13 


COLUMN? 31 


LENGTH? 9 


63. 


UNE? 14 


COLUMN? 1 1 


LENGTH? 9 


64, 


UNE? 14 


COLUMN? 21 


LENGTH? 9 


65, 


UNE? 14 


COLUMN? 31 


LENGTH? 9 


66, 


UNE? 15 


COLUMN? 11 


LENGTH? 9 


67. 


UNE? 15 


COLUMN? 21 


LENGTH? 9 


68. 


LINE? 15 


COLUMN? 31 


LENGTH? 9 


69, 


LINE? 16 


COLUMN? U 


LENGTH? 9 


70. 


UNE? 16 


COLUMN? 21 


LENGTH? 9 


71. 


UNE? 16 


COLUMN? 31 


LENGTH? 9 


72. 


UNE? 17 


COLUMN? 11 


LENGTH? 9 


73. 


UNE? 17 


COLUMN? 21 


LENGTH? 9 


74, 


UNE? 17 


COLUMN? 31 


LENGTH? 9 


75, 


UNE? 18 


COLUMN? 11 


LENGTH? 9 


76, 


UNE? 18 


COLUMN? 21 


LENGTH? 9 


77, 


UNE? 18 


COLUMN? 31 


LENGTH? 9 


78. 


LINE? 19 


COLUMN? 11 


LENGTH? 9 


79. 


UNE? 19 


COLUMN? 21 


LENGTH? 9 


80. 


UNE? 19 


COLUMN? 31 


LENGTH? 9 



Screen 5 is the year-to-date budgeted and actual variable expenses, . 
We will now define the display positions for the BUDGET ACTUAL 
and DiFF'CE columns. 



Screen 3 is the current month's budgeted and actual income state- 
ment. We will now define the display positions for ttie DIFPCE 
column and the totals line. 

NO. OF DISPLAY POS'N ON SCREEN 3 ? 12 



36. 
37. 
38. 

39. 
40. 
41. 



LINE? 5 
LINE? 5 
LINE? 5 
UNE? 8 
UNE? 8 
LINE? 8 



COLUMN? 11 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 
COLUMN? 31 



LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 



NO. 
81, 
82. 
83, 
84. 
85. 
86. 
87. 
88, 
89. 
90. 
9L 
92, 
93. 
94. 
95, 
96. 
97. 
98. 
99. 

too. 



OF DISPLAY POS'N ON SCREEN 5 ? 45 



UNE? 5 
UNE? 5 
UNE? 5 
LINE? 6 
UNE? 6 
UNE? 6 
UNE? 7 
LINE? 7 
UNE? 7 
UNE? 8 
UNE? 8 
UNE? 8 
UNE? 9 
UNE? 9 
UNE? 9 
LINE? 10 
UNE? 10 
UNE? 10 
UNE?n 
UNE? 11 



COLUMN? 11 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 
COLUMN? 31 
COLUMN? 11 
COLUMN? 21 
COLUMN? 31 
COLUMN^ 1 1 
COLUMN? 21 
COLUMN? 31 
COLUMN? II 
COLUMN? 21 
COLUMN? 31 
COLUMN? 11 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 



LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH-^ 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 



Til* Tranxictor 



16 



Volum* 5, 1»U0 06 



101. 


LINE? i I 


COLUMN? 31 


LENGTH? 9 


102. 


LINE? 12 


COLUMN? 1 1 


LENGTH? 9 


102. 


LINE? i 2 


COLUMN? 21 


LENGTH? 9 


103. 


LINE? 12 


COLUMN? 31 


LENGTH? 9 


104. 


LINE? 13 


COLUMN? U 


LENGTH? 9 


105. 


LINE? 13 


COLUMN? 21 


LENGTH? 9 


106. 


LINE? 13 


COLUMN? 31 


LENGTH? 9 


107. 


LINE? 14 


COLUMN? 11 


LENGTH? 9 


108, 


LINE? 14 


COLUMN? 21 


LENGTH? 9 


109. 


LINE? 14 


COLUMN? 31 


LENGTH? 9 


110. 


LINE? 15 


COLUMN? n 


LENGTH? 9 


111. 


LINE? 15 


COLUMN? 21 


LENGTH? 9 


112. 


LINE? 15 


COLUMN? 31 


LENGTH? 9 


113. 


LINE? 16 


COLUMN? 11 


LENGTH? 9 


\\4. 


LINE? 16 


COLUMN? 21 


LENGTH? 9 


115. 


LINE? 16 


COLUMN? 31 


LENGTH? 9 


116. 


UNE?17 


COLUMN? 1 1 


LENGTH? 9 


117, 


UNE7I7 


COLUMN? 21 


LENGTH? 9 


118, 


LINE? 17 


COLUMN? 31 


LENGTH? 9 


119. 


LINE? 18 


COLUMN? 11 


LENGTH? 9 


120. 


LINE? 18 


COLUMN? 21 


LENGTH? 9 


121. 


LINE? 18 


COLUMN? 31 


LENGTH? 9 


122. 


LINE? 19 


COLUMN? 11 


LENGTH? 9 


123. 


LINE? 19 


COLUMN? 11 


LENGTH? 9 


124. 


LINE? 19 


COLUMN? 21 


LENGTH? 9 


125. 


LINE? 19 


COLUMN? 31 


LENGTH? 9 



Screen 6 is the year-to-date budgeted and actual income statement. 
We will now define the display positions lor the BUDGET ACTUAL 
DIFF'CE columns and the TOTALS. The GROSS SAVINGS totals are 
displayed on line 19, 



NO. 
126. 
127, 
128. 
129. 
^30. 
131. 
132. 
133. 
134. 
135. 
136. 
137. 
138. 
139, 
140. 



OF DISPLAY POS^N ON SCREEN 6 ? 15 



LINE? 6 
LINE? 6 
LINE? 6 
LINE? 10 
LINE? 10 
LINE? 10 
LINE? 12 
LINE? 12 
LINE? 12 
LINE? 14 
LINE? 14 
LINE? 14 
LINE? 19 
LINE? 19 
LINE? 19 



COLUMN? 11 
COLUMN? 21 
COLUMN? 31 
COLUMN? U 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? U 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 
COLUMN? 31 
COLUMN? 1 1 
COLUMN? 21 



LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 
LENGTH? 9 



Budget Calcutationa In the Arithmetic File 

After entering all the display positions, you will be in the Edit Mode of 
the Arithmetic Editor. 

Comments are preceded by a semicolon. I've included comments to 
help you understand how the arithmetic operates, you may leave 
them out if you wish as they are not necessary for Ihe arithmetic to 
work. The arithmetic just follows the screens in order, doing the 
required math to get a figure for each display position. 



• INCOME {SCREEN 1) 

N3-N2to2Dl 

N5-N4 to 2D2 

N7-N6to2D3 

N2 + N4 + N6toRl 

Rl to2D4 

N3 + N5 + N7toR2 

R2 to 2D5 

R2-R1 to 2D6 

;FIXED EXPENSES 



:CALCULATEDIFF'CES 



;R1=ACT'LINC. TOTAL 
;R2 = BUDGET1NCT0TA15 



; DIFF'CE 



8loR7 

7 to RIO 

WHILE R7< 24 DO 

N(R7)-N(R7-fl}TO2D(R10} 

R7 + 2 TO R7 

R10+ 1 TO RIO 

ENDWHILE 

0TOR3 

8TOR7 

WHILE R7< 24 DO 

N(R7) + R3 TO R3 

R7 + 2 TO R7 

ENDWHILE 

R3T0 2D15 

0TOR4 

9TOR7 

WHILE R7 < 24 DO 

N(R7) + R4 TO R4 

R7 -f 2 TO R7 

ENDWHILE 

R4T0 2D16 

R3-R4T0 2D17 



;R7 ISA FIELD* COUNTER 
;R10 IS DISPLAY POS'N 



;R3 = BUDGET FIXED EXP, 



;R4 = ACTUAL FIXED EXP. 



;FIXED EXPENSE DIFF'CE 



;VARIABLE EXPENSES (SCREEN 2) 

26 TO R7 

ISTORIO 

WHILE R7< 56 DO 

N(R7)-N(R7+l)TO2D(R10) 

R7 + 2 TO R7 

RIO + 1 TO RIO 

ENDWHILE 

26 TO R7 
0TOR5 
WHILE R7< 56 DO 

N{R7} + R5 TO R5 
R7 + 2 TO R7 
ENDWHILE 
R5 TO 2D33 

27 TO R7 
0TOR6 

WHILE R7< 57 DO 
N(R7) -f R6 TO R6 
R7 + 2 TO R7 
ENDWHILE 
R6 TO 2 034 
R5-R6 TO 2D35 



;R5 = BUDGETVAR. EXR 



;R6 = ACTUALVAR.EXR 



;VAR. EXP. DIFF'CE 



;NET INCOME FOR CURRENT MONTH RECORD (SCREEN 3) 

Rl T0 2D36 

R2T0 2D37 

R2-R1T0 2D38 

R3T0 2D39 

R4TO2D40 

R3-R4T0 2D41 

R5T0 2D42 

R6T0 2D43 

R5-R6 TO 2D44 

Rl-(R3 + R5)TOR8 

R8 TO 2D45 

R2 - (R4 + R6) TO R9 

R9T0 2D46 

R8-R9T0 2D47 

• • YEAR-TO-DATE ^' 

IN THE WHILE LOOP BELOW 

ALL YEAR-TO-DATE INCOME, FIXED EXPENSES 

& VARIABLE EXPENSES ARE ACCUMULATED IN 

REGISTERS & DISPLAYED ON THE SCREEN 

48 TO RIO 

2TOR7 

12T0R11 

TO R99 



SET DISPLAY POS'N START * 
SET START OF FIELD INDEX * 
SET START REGISTER * 
R99 AS TEMP. STORAGE 



Th« Trdnscictor 



17 



Volumo 3, l»utt 06 



WHILER10<126DO 

IF R7 = 24 THEN R7 + 2 TO R7 ;SKIP NOTES 

ENDIF 

N(R7]+ R(R11)T0R{R11) 

R(Rll)TO2D(R10} 

N(R7-fl}+ R(Rll + l)TOR(Rn + l) 

R(Rll + l)TO2D(R10-f 1) 

TO R99 ;R99 AS TEMP STORAGE 
R(R]l4-l)-R(R(n))TOR99 

R99TO2D(R10 + 2) 

RIO +3 TO RIO 

R7 + 2 TO R7 

Rll +2T0RU 

ENDWHILE 

;[NCOM£ TOTALS YEAR-TO-DATE 

R12 + R14 + R16TOR90 

R90 TO 20126 

R13 + R15 + R17TOR91 

R91T0 2D127 

R91-R90TO2D128 

;FIXED EXPENSE TOTALS YEAR-TO-DATE 

RI8 + R20+R224-R24 + R26 + R28-fR30 + R32TOR92 

R92T0 2D129 

R19 + R21 + R13 + R25 + R27 + R29-fR31+R33TOR93 

R93TO2D130 

R92-R93T0 2D131 

;VARiABLF EXPENSE TOTALS YEAR-TO-DATE 

;BUDGET TOTALS 

34 TO Rl 1 ;S£T START REGISTER* 

1 TORI 00 
TO R94 

WH]LERIOO<1GDO 
R(Rll)+ R94TOR94 
RlOO 4- ITORIOO 
RU +2 TO Rll 
ENDWHILE 
R94T0 2D132 

;ACTUAL VARIABLE EXPENSE TOTALS 

35 TO Rl 1 ;SET START REGISTER* 
ITORIOO 

TO R93 

WHILE RlOO < 16 DO 

R(Rn) + R95TOR95 

RlOO + I TO RlOO 

Rll + 2 TO Rll 

ENDWHILE 

R95T0 2DI33 

R94-R95T0 2D134 ;DiFPCE 

:YEAR-TO-DATE NET INCOME 

R90 ' (R92 + R94S TO R9fi ;BUDGET 

R96T0 2D135 

R91-(R93 + R95)T0R97 

R97T0 2D136 

R97-R96T0 2DI37 

R96 + RI8T0 2D138 

R97 + RI9T0 2DI39 

R96-f R18-R97-RI9 TO 2D140 



;ACTUAL 

jDIFPCE 
;GROSS SAVINGS 



Setting Up Your Budget and Entering Records 

The first thing to do is look at a whole year's income and expenses at 
once. Go into the Enter/Edit option and enter record \ as your year 
budget. Then use the " what if " feature (The = key) to plan your year 
budget. Enter trial amounts then press the back arrow key to let the 
arithmetic calculate your net income on screen 3. Remember to use 
F7 to advance a screen and F8 to return to the previous screen. 

Keep playing with the amounts until you get the savings and net 
income amounts you wish to aim for Be reaiisticl Overly optimistic 
forecasts can lead to family feuds or chronic depression. It is always 
better to find you saved more than you expected, 



Once you're happy with the figures, screen print the first 3 screens, 
This year budget is your guestimale of what your year-to-date 
screens will show at the end of the year. 

Note; We are only using the screen on record 1 to fiddle with our year 
budget. Record 1 will eventually be the first month of our budget. 

Now on a piece oi paper divide expenses by 12 to get a monthly 
amount. This only works of course for common monthly expenses. 
Large amounts such as insurance, tax payments etc. will have to 
entered in individual months. 

Now create 12 records, 1 record for each month of your budget. Do 
this simply by entering the date in field I of each record. Put the date 
in this format, e.g. Jan 1, 1985 would be 850101, 

Now use the first 3 screens in record I to play with the amounts for 
your month budget until you gel some reasonable figures. Use the 
'what if (' = ' key) to calculate the effect of changing the amounts. 

Next make global entries in the budget column of record 1 by using 
the Shift 'C change function. Enter any amounts that are constant 
every month or you have calculated l/l2thof the yearly amount. My 
experience has shown that you can only change 10 fields at a time. 
Thus, you may have to do this operation more than once. You should 
now have entries in the budget column of all 12 months. 

The next thing to do is to enter special amounts in the budget column 
that you know are due in certain months, e,g. tax or insurance 
payments. After doing this every month's budget column should be 
complete, i.e, reflect your best estimate of income and expenses for 
that month- 

You can now use the 'accumulate' function to look at the year-to-date 
amounts (screens 4 to 6) for the whole year. You may decide at this 
time to revise some of those global entries. If you want the accumulate 
to only go as far as a certain month, enter the complex search string 
(F5) for the month you want it to stop at, e.g. up to May would be Nl < 
850601 

Note: You may see outrageous amounts appearing in the year-to-date 
display positions on your screen. This is because the accumulator 
keeps adding when you go from record lo record. The only way to 
clear it and get correct amounts is to re-execute the 'accumulate' 
function. 

One more thing - how to avoid cash flow problems. The reason for 
GROSS SAVINGS is to help you figure out ahead of time whether you 
will have enough money on hand, i.e. your paycheck and your 
savings account, lo cover a month's expenses. Doing an 'accumulate' 
up to any month will tell you this. i.e. if GROSS SAVINGS is a negahve 
amount you are in trouble. Then it's lime to go back and budget more 
for your savings account. 

You are now in a position to make entries In the ACTUAL column al 
the end of each month. At this point you're on your own. Improvise 
methods that suit your perception of what financial information is 
necessary in order to make this budget work for you. For example, it 
just occurred lo me that it might t>e helpful if initially all ACTUAL 
amounts were entered ahead of lime (i.e. the same as BUDGET 
amounts). Then each month the amounts in the ACTUAL column 
would be changed lo reflect reality. An accumulate over the year 
would immediately show the effect of this month's entries on what 
was left of the year budget. 

May your budgeting efforts in the new year add ralher than subtract 
from your enjoyment of life! 

DONT PHONE - WRITEI 

If you have questions regarding this application or you would like to 
submit your own "terrific" application, please write me a legible, 
coherent letter. If you submit an application, send it on disk or al least 
send screen dumps of the ENTER/EDIT screen, a hand-drawn report 
chart and any math and sample data. I will attempt to answer letters in 
this column. Write to: Don Bell, P,0 Box 23, Scotland, Ontario, 
Canada, NOE IRO _^^_ 



Th« IranKictor 



18 



Volum* 5, Uive 06 



or 



TransBASIC 
Installment ^2 



Nick Sullivan 
Scarborough, Ont. 



in the first instalimeni of TronsBASlC, Nick infroduced the concept of his objective: lo 
Creole a metfiod for building custom commands and incorporate them into the BASIC 
command set. Also in part /, the TransBASIC Kernei was described. To lake advantage of 
new TransBASIC command listings, one must first obtain a copy of the TransBASiC 
Kernei The Kernei is only about 500 bytes long, but the source fisting of the Kernei is quite 
long and can 'I be printed each time. Volume 5. issue 05 (Hardware & Peripherals) contains 
the printed listing, however The Transactor Disk for every issue will include tiiis file, plus 
fifes from the current and all previous TransBASIC articles. 



The Structure of a TransBASIC Module 



The TransBASIC syslem is basically a long program in assembler 
source code wiih one compulsory and many opiional par!s. The 
compulsor>' pari is called ihe kernel. The other parts — the optional 
ones — are called modules. 

The kernel and all the modules are written with tht? PAL assembler, 
which uses the BASIC editor to create source code. At some point the 
selected modules must be merged with Ihe kernel, and assembled. 
The merge routine is one that was actually written for merging BASIC. 
But since PAL source files are structured just like BASIC text, this 
merge works quite nicely {thank you again Glen Pearce), 



n the next range of lines you would put any statement keywords 
you'll be needing in your module (function keywords come a tittle 
later on). The TransBASIC statement keyword list occupies lines 100 
through 597; the CURSOR statement is entered at line 101. Note that 
the last character in each keyword has its high byte set. In modules 
you write yourself use lines 400 through 597 for your keywords. 



The following 500 lines are for function keywords; the 'Cursor Posi- 
tion' function CLOC, for example, occurs on line 600. The organiza- 
tion is identical to that for statements. The safest part of this area is 
again the end, from 900 through 1095. 



in order for modules to be merged non -destructively with the kernel 
and with each other, a unique line range has been assigned to every 
subsection of the source code. The execution routine for each module, 
for instance, occupies certain lines that are reserved for it alone. Other 
lines have been reserved for the kernel, others for statement and 
function keywords, others still for equates, for routine addresses, and 
for link vector storage. 

One of the modules given in this issue is called 'Cursor Position', It 
contains two commands — the statement CURSOR, and the function 
CLOC. ril use Cursor Position' in the following discussion to illustrate 
the anatomy of a TransBASIC module. This discussion will give you 
an idea of how to structure any modules you write on your own. 

The first few lines of 'Cursor Position' are BASIC REM statements. 
Similar documentary lines, using as much as necessary of the line 
range through 24, will be found in every module. The numbering 
and format are standardized: in your own modules you should follow 
Ihe pattern as closely as you can. Incidentally, this first line range is 
the only one in the TransBASiC system that are not uniquely assigned. 
This is okav because these lines are intended for reference at the time 
the module containing them is merged into memory — it doesn't 
matter if the module after that overwrites them. 

If the 'Cursor Position' module contained any equates they would 
come next. At the moment the only equates in use in TransBASIC are 
those defining the reserved zero page work area at locations two 
through six, and those defining operating system (Kernal) routines in 
the 'ADD' module. That leaves plenty of room for further equates if 
you want them: lines 50 through 90 should be safe. 



The address of the execution routine for each keyword is given on the 
line whose number is exactly 1000 greater than Iheoneon which the 
keyword itself is entered. The numbers here are actually the routine 
addresses minus one, owing to the particular method by which the 
routines are accessed. 

The only other part of a module Is the block of execution routines 
itselL You will be entirely safe for the foreseeable future if you number 
your routines in the upper part of the range the BASIC line editor 
accepts — above 50000, say. I number Ihe execution routines by twos 
in order lo allow a little hit of room for revision withoul the necessity 
of using harder-to-follow multiple statement lines. 

If you glance at Ihe listing of the TransBASIC kernel (printed in last 
issue) you'll see at once that the lines are not all contiguous, but are 
scaUered in various blocks throughout Ihe range 25 to 2572. Since you 
won't need lo make any changes lo kernel lines I won'l list Ihe details 
of the line assignments here. In fact, you can generally ignore the 
kernel altogether, even though it does most of the work of linking in 
new commands, 

TransBASIC offers probably the easiest way to extend BASIC wilh 
your own custom commands. A brief glance at some existing modules 
will show you just how little effort is necessary for sculpting a new 
one, 

A typical TransBAStC command uses lots of ROM routines, particu- 
larly for expression evaluation. In the next issue we'll look at some of 
those routines and how to use them. 



Tha Ik-an factor 



19 



Volumo 5, l»u» 06 



New Commands 

This part of the TransBASIC column is devoted lo describing the new 
commands that will be added each issue. The descriplions follow a 
standard format: 

The first line gives the command keyword, the type {statement or 
function), and a three digit serial number. 

The second line gives the line range allotted to the execution routine 
for the command. 

The third line gives the module in which the command is included. 

The fourth Une (and the following lines, if necessary) demonstrate the 
command syntax. 

The remaining I ines describe the command. 

CURSOR (Type; Statement Cat *: 004) 

Line Range: 2574-2604 

Module: CURSOR POSITION 

Example: CURSOR 11 

Example: CURSOR ROW,COL 

Moves the cursor to specified row (0-24} and column (0-39). Column 

zero is assumed if no second parameter is present. 

CLOC (Type: Function Cat*: 005) 

Line Range: 2606-2618 

Module: CURSOR POSITION 

Example: IF PEEK(CLOCK>32 GOTO 100 

A quasi-variable that returns the actual memory location of the 

cursor. 

DOKE (Type: Slalemenl Cat ': 007) 

Line Range: 2636-2672 

Module; DOKE &DEEK 

Example: DOKE 788,59953; REM RESET IRQ VECTOR 

Pokes a 16-bit value into a pair of memory locations, the lower of 

which is specified in the command. The IRQ interrupt is switched out 

during the poke so this command may be used, as in the example, to 

change the vector safely. 

DEEiq (Type: Function Cat ': 008) 

Line Range: 2674-2696 

Module: DOKE &DEEK 

Example: PRINT "TOP OF BASIC AT ^ DEEK(55) 

Returns the 16-bit value of a pair of memory locations, the lower of 

which is specified in the command. Standard low-high format is 

assumed. 

SET (Type; Statement Cat *: 009) 

Une Range: 2698-2706 

Module: BIT TWIDDLERS 

Example: SET ADDR.MASK 

An 8-bil value (MASK) is ORed into the address. Bits that are set in 

MASK will be switched on at the specified location; other bits will be 

unaffected. 

CLEAR (Type: Statement Cat-: 010) 

Module: BIT TWIDDLERS 

Example: CLEAR ADDR,M ASK 

Bits that are set in the 8-bil value MASK will be cleared at the 

specified location; other bits will be unaffected. 



FUP (Type; Statement Cat*: Oil) 

Line Range: 2720-2728 

Module: BIT TWIDDLERS 

Example: FLIP ADDR,MASK 

Bits that are set in the 8-bit value MASK will be complemented at the 

specified location; other bits will be unaffected, 

CHECK( (Type: Function Cat-':018) 

Line Range: 2834^2882 

Module: CHECK & AWAIT 

Example: A = CHECK( " AEIOU " ) 

[f there is a character in the keyboard buffer, it is tested against each 

character of the string argument (here " AEIOU ' ) in turn until either a 

match is found or every character has been checked. If there is a 

match, the position of the matching character in the string {from 1 to 

255) is returned, [f there is no match, or if the keyboard buffer was 

empty, zero is returned. 

AWAIT( {Type: Function Cat *: 1 9) 

Line Range: 2838-2886 

Module; CHECKS AWAIT 

Example: A = AWAIT( ' NESWQ " ): ON A GOTO 1 0,20,30,40: END 

Identical in operation to CHECK( except that it won't take no for an 

answer, but will wait for keyboard input and a successful match: this 

function never returns zero. 

KEYWORDS (Type: Statement Cat •: 059) 

Line Range: 4940-4980 

Module: KEYWORDS 

Example; KEYWORDS 

All active TransBASIC keywords are printed. 



MP 

FH 

Jl 

HH 

JO 

JH 

NJ 

IN 

BE 

NH 

ME 

PH 

KO 

Bl 

FJ 

GK 

BG 

FE 

fB 

GM 

IN 

OH 

BB 

FJ 

NH 

AW 

NO 

KE 

GE 

OC 

Gl 

DO 

KL 

PL 

IF 

CM 

JG 

LN 



rem doke & deek (aug 24/84) : 

1 : 

2 rem 1 statement, 1 function 

3 : 

4 rem keyword characters 9 

5 : 

6 rem keyword routine hne ser# 

7 rems/doke dok 2636 007 
S rem f/deek( deek 2674 008 

9 : 

10 rem u/usfp (2620/006) 

11 : 

13 : 

102 .asc "dokE" 

601 ,asc 'deek" : .byt$a8,deek + shifled( 

1102 worddok-l 



1601 word deek 

2620 ustp 

2622 

2624 

2626 

2626 

2630 



■ 1 



Idx #0 

stx $0d 

&ta $62 

sty $63 

Idx #$90 

sec 

jmp $bc49 



2632 
2634 , 

2636 dok jsr $ad8a 

2638 isr $b7f7 

2640 jsr $aefd 

2642 Ida $14 

2644 sta t3 

2646 Ida $15 

2648 Sta 14 

2650 jsr $ad8a 

2652 jsr $b7f7 

2654 Ida $14 

2656 Idy #0 

2658 sei 



routine to concert 
unsigned integer 
in a (higti byte) 
and .y (low byte] 
to floating point 
:infpa#l 



get poke address 
convert to integer 
check for comma 
store address 
aslemp vector 



get poke value 
convert to integer 
low byte to poke 
indirect index 
turn off irq 



Ihm 'h'onKictor 



30 



Volumo 5, \»»itm 06 



NL 
El 
LA 
PM 
CN 
KF 
GO 
DN 
AP 
CA 
Dl 
BW 
IP 
HE 
JL 
BF 
MA 
FH 
OP 



HH 
FH 
GH 
HH 
FE 
JH 
NJ 
ID 
OF 
EN 
OH 
CN 
Al 
LD 
CI 
OP 
JK 
BA 
MK 
EC 
MM 

lA 
GE 
DP 
NJ 
AD 

H 

EB 
KB 
NG 
KD 
CJ 
OB 
GH 
LP 
W 
MJ 

IC 



FO 

FH 

OH 

HH 

FE 

JH 

NJ 

EP 

Nl 

NH 

NP 

PH 

KD 

Bl 

Jl 

IP 

OL 

IK 



2660 sta 

2662 Ida 

2664 iny 

2666 sla 

2668 dl 

2670 rts 

2672 ; 

2674 deek )sr 

2676 jsr 

2678 jsr 

2680 Idy 

2682 Ida 
2684 pha 
2686 dey 

2683 Ida 
2690 tay 
2692 pla 
2694 jmp 
2696 ; 



(t3),y 
$15 

(i3).y 



$aef4 

$ad8d 

$b7f7 

#1 

($14).y 



[Si-ij.v 



usfp 



;save low byte 
;highby!elopoke 
;bump index 
;save high byte 
;irq on again 



get val, test ^)' 
test tor numeric 
conv to integer 
indirect index 

get high byte 

;decrement mdex 
;get low byte 



; convert to tp 



rem bit twiddlers (sept 4/84) 

1 : 

2 rem 3 statements, functions 

3 : 

4 rem keyword characters; 12 

5 : 

6 rem keyword routine \\ne 

7 rem s/set bse 2698 

8 rem s/clear bclr 2706 

9 rem s/flip fli 2720 

10 : 

11 remu/bprep(2730/012) 

12 : 

13 rem ------------ = = 

14 : 

103 asc ■ seTcleaRfliP " 
1103 .wordbse-1.bclr'1,fli-1 



ser# 
009 
010 
Oil 



|Sr 
eor 



bprep 

#$ff 
and ($l4),y 
sta ($14),y 
rts 



2698 bse jsr bprep 

2700 ora ($14),y 

2702 sla ($14),y 

2704 rts 

2706 ; 

270B bclr 

2710 

2712 

2714 

2716 

2718 ; 

2720 fli jsr bprep 

2722 eor ($14).y 

2724 sla ($14).y 

2726 rts 

2728 ; 

2730 bprep jsr $b7eb 

2732 txa 

2734 Idy #0 

2736 rts 

2738 : 



; setup 

;set masked bits 

; Store 



; setup 
; in vert mask 
,cfear masked bits 
; store 



; setup 

;f|jp masked bits 

; store 



addrto$14/15, 
value to a 
setjndextoO 



rem check & await (aug 25/64) 

1 : 

2 rem statements, 2 functions 

3 : 

4 rem keyword characters, 12 



3er# 

018 

019 



6 rem keyword routine line 

7 rem f/check( check 2834 

8 rem f/await( await 2838 

9 : 

10 rem u/getter (2888/020) 

11 : 

12 rem =-------*-------- ---- 

13 : 

602 asc "checkawait" 

1602 ,wordcheck-1,await-1 

2834 check sec ;sel flag 'check' 

2836 .byte $24 ;ignoredc 



FA 


2838 


await 


cic 




clr flag 'await' 


EA 


2840 




php 




save flag 


FG 


2842 




jsr 


$aef4 ; 


evaluate string, 


NN 


2844 




jsr 


$b6a3 ; 


c r descr stack 


DE 


2846 




sta 


t3 ; 


savestr ength 


B 


2848 




pip 




save flag 


LH 


2850 




ror 


14 


minus = check' 


BM 


2852 


awl 


jsr 


getter ; 


test key buffer 


ED 


2854 




bit 


t4 


test f ag 


GD 


2856 




bmi 


aw2 ; 


skip if 'check' 


AF 


2858 




tay 




try again if 


GP 


2860 




beq 


awl ; 


buffer empty 


GA 


2662 


aw2 


Idy 


#$ff ; 


initialize index 


PI 


2864 


aw3 


iny 




bump index 


fvID 


2866 




cpy 


t3 i 


skip if end 


AF 


! 2868 




beq 


aw4 ; 


of sthng 


BF 


1 

2870 




cmp 


{$22),y ; 


test for match 


CE 


2872 




bne 


aw3 




PF 


2874 




beq 


aw5 




JD 


2876 


aw4 


bit 


14 : 


test flag 


CH 


2878 




bp 


awl ; 


OOP if await' 


EE 


2880 




Idy 


#$ff : 


return 


Al 


2882 


aw5 


iny 




pos'n in string 


IP 


2884 




jmp 


$b3a2 


,ytofpintac1 


fVlL 


2886 


9 








OG 


2888 


getter jsr 


$a82c 


,tesl stop key 


EH 


2890 




imp 


$e124 


.basics getin 


Cf^ 


2892 


n 








LS 


rem 


keywords (aug 25/84) 


■ 


FH 


1 ; 










Al 


2 rem 


1 1 slatement^O functions 


Y^[^ 


3 : 













4 rem 


1 keyword characters 8 




JH 


5 : 










NJ 


6 rem 


1 keyword i 


outine lint 


i ser# 


IL 


7 rem 


1 keywords 1 


<wrds 4940 059 


f^H 


8 : 










OH 


10 : 










BP 


116 ,i 


iSC'f 


keywords 




DF 


1116 


word kwrdi 


1-1 




JP 


4940 


kwrds jsr 


$aad7 


; print return 


HP 


4942 




Idy 


#0 


; keyword index 


EK 


4944 


kwrl 


Idx 


#0 


;coumn counter 


PP 


4946 


kwr2 


da 


skw.y 


,get keyword char 


KE 


4948 




beq 


kwr4 


;skipat istend 


PJ 


4950 




php 




;save status reg 


DB 


4952 




and 


ff$71 


;make lower case 


FL 


4954 




jsr 


$ab47 


; print character 


OJ 


4956 




iny 




;bump kword index 


LA 


4958 




inx 




;bump col counter 


OH 


4960 




pip 




, oop if not 


At 


4962 




bpl 


kwr2 


; end of word 


LH 


4964 


kwr3 


cpx 


#$0a 


;print spaces to 


GE 


4966 




beq 


kwrl 


;padto10or20 


PA 


4968 




cpx 


#$14 


;coLjmns 


EL 


4970 




beq 


kwrl 




PL 


4972 




jsr 


SabSt 




KE 


4974 




inx 






NK 


4976 




bne 


kwr3 




NG 


4978 


kwr4 


jmp 


$aad7 


; print return 


KO 


4980 


• 









Th« Troniactor 



21 



Vblum* 5/ liiu« 06 



A New Wedge 

For The Commodore 64 

Add commands by trapping Syntax Errors 



Brian M unshaw 
M ississauga, Ont. 



In an issue dedicated to programming aids and utilities, ( thought it 
would be fitting to not only offer up some utilities, but to supply a 
superior method of adding them right to BASIC. In effect, add com- 
mands. This is the technique hinted about by Richard and Chris in 
previous articles, so in an effort to appease their collective curiosities, 
here it is- 

Most of you are probably familiar with the 'chrget' wedge. It is 
characterized by using a special character, such as '®'. 7' or '>', 
which precedes all commands. Both DOS 5,1' and 'The Manager' use 
this technique. 

The chrget' wedge, however, has its drawbacks. It is what you might 
call a brute force method. Basically, the normal character retrieval 
done by BASIC is re-routed through a special routine which checks 
for a special 'wedging' characler(s). Depending on how much check- 
ing is done, the process can slow down BASIC considerably. Some 
estimates indicate the slow down is around fifteen percent- Syntactic 
anomalies also develop. The one that comes to mind first is the 
problem that arises in the 'if - then' construct. In the following 
example the wedge command always executes, 

if 1 = then ©command 

This might seem absurd as the expression is always false, but unless 
this special condition is checked for, it will always execute. As a user 
ofsuch a utility, to program around this, you would have to first insert 
a colon in front of the wedge command. Similarly, unless quote mode 
is checked for, the following will also invoke the wedge command. 

print " ©command " 

The point is, unless a lot of extra checking is done to ensure against 
these and other problems, the average wedge takes a considerable 
slice of time for each and every character requested from it by BASIC. 
Generally, the better the wedge performs syntactically, the slower 
BASIC executes. 

This isn't to fault the programming expertise of the original developer 
of the technique. He or she had few alternatives to this method on the 
PET, (which \ assume is where the process was developed} However, 
the 64 is a different matter. (So is the VIC. but this article addresses 
itself to the 64 only? I suppose with very little effort, this technique will 
also work on the VIC) 

The interpreter and kernal of the 64 makes extensive use of indirect 
jumps through vectors in RAU. more so than does the PET, The 
importantvectorinthiscaseistheoneat $0300 called 'lERROR' in the 
programmers reference guide. 

The method I'm proposing will on the surface appear to be the same, 
but will exhibit none of the problems of the 'chrget' wedge. This 
method also requires a special preceding character for all commands, 
but from there on it's entirely different. 

Let's consider what would happen if you just included the hypotheti- 
cal command ^©superdooper' to a line of BASIC, The obvious result is 
a syntax error when BASIC tries to execute it. But it is a very special 



syntax error, in that this specific syntax error occurs at the start of a 
statement. How can this be used to advantage? Let's examine in more 
detail what is actually happening. First, BASIC was happy right up to 
the statement before the ©superdooper command. Part of the execu- 
tion of that statement included positioning the text pointer {at $7a and 
$7b) on the first character or token of the next statement. In this case, 
this is the special character '©'. Since this character's ASCII value is 
less than 128, BASIC knows it's not a token (all tokens have the high 
bit set, hence must be greater than or equal to 128}, and gets ready to 
execute an implied 'LET' statement, also known as an assignment 
statement. Ah, but there's the rub! It can't be an implied XET'I Why? 
Well the '©■ is not a valid character for a variable name. What 
happens as a side effect of ah this is two stack places are used, the x 
register is loaded with $0b signifying a syntax error, and an indirect 
'jmp' is done through the 'lERROR' vector at $0300. This routine 
causes the appropriate error message to be printed, and execution 
halts. 

What is of extreme importance is the consistency of these events. If 
you change the vector at $0300 to point to a routine that will check for 
your new command, and if found, will fix up the stack, scan to the 
next statement which allows BASIC to continue by jumping to the 
routine to execute the next statement, then you^ my friend, have a 
new type of wedge> the 'error' wedge. 

Most BASICS found today (excluding Commodore variants) have an 

'on error goto/gosub' or 'trap' command. This is approximately the 
same thing, it is closer to an 'on syntax error sys' though, but this is 
exactly what ! wanted to accomplish, A way to pass into machine code 
to execute the utility. It isn't a brute force method, like the 'chrget' 
wedge, hence doesn't slow down BASIC. It only affects processing 
when the command is encountered. This technique is certainly more 
elegant than having a separate 'sys' for each command, utility or aid 
and finally, it is somewhat easier than altering the tokenising and 
token dispatching to add commands to basic. Another nice feature 
comes from the fact that the kernal doesn't re-initiaijze the vector at 
$0300 with every warm start, therefore you don't have to re-engage il 
every time you press a run/stop - restore. This is the case when you 
scan for specific keyboard entries, like the function keys which some 
schemes do by altering the IRQ vector. 

More to showcase this technique than anything else, I've included 
those commands which are a subset of a graphics utility I've written, 
which pertain to external devices, like the disk drive. These include 
utilities to list the directory or a program to the screen, a command to 
list a sequential text file to the screen, a command to alter the defauh 
output device, a command to send commands to the disk drive, two 
commands to read the disk status and finally a command to disable 
the utility. 

The syntax for these commands are as follows. Please remember that 
the special character, '@' in this instance, must precede each com- 
mand. Also as a side effect of the way the commands are parsed, each 
command will have a short form. The shortest acceptable will be 
given with the full name in each case. For those of you who don't like 
the preceding '©' character, and would prefer another, then poke 
49152 4- IO,asc("character'').Theonlyruleyou must keep in mind 
when choosing a character is it must cause an automatic syntax error 



Tho Tranioctor 



22 



Volum* 5, Isiue 06 



and have a CBMascii value less then 128. Possible characters do not 
include the malhematical operators +,-,*,/. Even though Ihey may 
havean ASCII value less than 128, the editor turns them into tokens, 
hence will have an ASCII value greater than 127 in BASIC text. 

COMMANDS : 

@ (Abbreviation: none) 

This command will display the disk status ol the default drive. 

©device, device * (Abbreviation: @de, device *) 

This command will allow the user to set a default outpul device. When 
the utility is first loaded and engaged, the default device number will 
be set to eight. This will allow users of disk drives set to device eight to 
■LOAD', 'SAVE', and 'VERIFY' without specifying a device number. If a 
user wishes to change this, then this command can be invoked to do 
so. Note, the rest of the commands will use the default device number 
when accessing a device, hence if you have two drives on line, 
remember you must alter to the appropriate device number to access 
the device which isn't set to default. 

@do9, string (Abbreviation: @do, string) 

This command will send the characters in the string (literal or 
variable) to the default device using secondary address fifteen, ie. send 
commands to the disk drive. 

@dstatus, var$ (Abbreviation: @ds,var$) 

This command will store the disk status in var$. Note var$ must be a 
string variable and works in either direct or program mode. 

@kill (Abbreviation: @Ic) 

This command disengages the utility. 

©list, string (Abbreviation: @1I, string) 

This command will, depending on the contents of the string literal / 
string variable, list either the appropriate directory or program to the 
screen. The device being accessed is assumed to be the default 
device. The syntax of the string is standard Commodore, eg; 

©list, ' $ ■ 

will list the directory (both if using a dual drive), 

©list, '$0:* = prg' 

will list the titles of all program files on drive zero and 

@Ilst, ' program name " 

will list the appropriate program to the screen. To cause the listing to 
pause, press and hold the space bar. To allow the listing to continue, 
release the space bar, 

©print, string (Abbreviation: ©?, string) 

This command will print a sequential text file to the screen. The 
filename is held in the string, literal or variable. Use the space bar to 
pause. 

The following is the assembler source listing and a basic program that 
will load and engage the utility. Once the loader has been run, you 
may wish to save it out with a monitor. If you do so, the code extends 
from $C0OO to $C2C3. As you will see from the assembler listing, 
extensive use is made of kernal and interpreter routines. For those of 
you out there just starting to gel your feet wet in the machine code 
world of the C64, this little program may help you in the set up and 
use of such resident routines. 1 hope you find the method of adding 
commands and the utilihes useful in your own endeavours. 



Listing 1: BASIC loader for the error wedge program. 



PJ 

LI 
DH 
DH 
GK 
KG 

DD 
AF 
IN 
JE 
lA 
CA 
IVIA 
GB 
AC 
KC 
ED 
IF 
Gl 
HJ 
EK 
NP 
LG 
CB 
BH 

PN 

CH 

EE 

AP 

GC 

DK 

KE 

FN 

IvIB 

HE 

LE 

CP 

CA 

IF 

10 

CI 

MK 

OD 

GM 

LA 

CL 

lA 

IP 

FJ 

DK 

AJ 

PJ 

NK 

NP 

FO 

EB 

NP 

FC 

KM 

MG 

OD 

EH 

DF 



10 rem' data loader for " error wedge " • 

20cs = 

30 for i = 491 52 to 49858:read a:poke i,a 

40cs = cs + a:next i 

50; 

60 if CSO86280 then print ■ 

'...* error in datasfatemenfs*"*": end 
70sys49152 
80 end 
100: 
1000 data 76, 52, 192, 139, 227, 165 



1010data244,237,245, 



1 020 data 

1 030 dala 

1 040 data 

1050 dala 

1 060 data 

1 070 data 

1 080 data 

1 090 data 

1 1 00 data 

1110data141, 0, 

1 1 20 data 

1130 data 



0, 
0, 

0, 
0, 

0, 

0, 

0, 



0, 
0, 

0, 
0, 
0, 
0, 
0, 



0, 
0, 
0, 
0, 
0, 
0, 
0, 



8, 
0, 
0, 
0, 
0, 
0, 
0, 



64, 
0, 
0, 
0, 
0, 
0. 
0, 



3,141, 
3,141, 











1 



0, 173, 

3, 192, 173, 

4,192, 169, 144 

3,169, 192, 141 

1, 3,173, 50, 3,141 

7, 192,173, 51, 3,141 



5,192 

6,192 

3,169 

96,174 



1140data 8.192,169,119,141, 50 
1150data 3, 169, 192, 141, 51, 3 
1160data173, 48, 3,141, 
1170data173, 49, 3,141, 
1180data169, 127,141, 48, 
1190dala192, 141, 49, 3, 
1200 data 9,192,134,186,108, 7 
1210data192, 174, 9, 192,134,186 
1220 data 108, 5,192, 32,115, 
1230data 32,158,173, 76,163,182 
1240 data 224, 11,240. 3,108, 3 
1250data192, 32.121, 0,205, 10 
1260 data 192, 240, 3,108, 3,192 
1270 data 104, 104, 32,170,192, 76 
1280data 6,169, 
1290 data 0,240, 
1300 data 2,208, 
1310 data 76, 87,194,201, 
1320 data 39, 32.115, 0, 
1330 data 45, 193, 104,201, 
1340data 7, 32,241,183,142, 9 
1350 data 192, 96,201, 79,208, 3 
1360 data 76, 99,193,201, 83,240 
1370data 3,108, 3,192, 32, 45 
1380data193, 76,116,194,201, 75 
1390data208, 40, 32, 45,193,173 



32,115, 
6,201, 
6, 32, 



0,201 
58, 240 
45, 193 
68, 208 
72, 32 
69, 208 



1 400 data 
1410 data 
1 420 data 
1430 data 
1 440 data 
1450 data 



3,192,141, 
4,192,141, 
7,192,141, 
8,192,141, 
5,192,141, 



0, 

1, 
50, 

51, 

48, 

49, 

6, 



3,173 
3,173 
3,173 
3,173 
3,173 
3, 96 
32, 45 



6,192,141, 
1460data201,155,208, 
1470data193, 76,132,193,201,153 
1480 data 208, 6. 32, 45,193, 76 
1490data 50,194,162, 11,108. 3 
1500data192, 32,121, 0,201, 

1510data240, 14,201, 44,240, 10 
1520data201, 58,240, 6, 32,115 
1530 data 0, 76, 48,193, 96, 32 
1540 data204, 255. 169, 127, 76,195 



Th* Tranioctor 



23 



Vbium* 5, lftu« 06 





Ml 


1 550 data 255, 32,135,192, 32,189 


Error Wedge Source Listing 




Kl 


1560data255, 164,253, 169, 127, 174 


oc 


100 sysTOO 




laaa^mbled on paf 64 




MF 


1570 data 9,192, 32,186,255, 32 


QN 


110 .oplcw 
120 ; 








PJ 


1580 data 192, 255, 162, 127, 76,198 


CA 


130 
140 ; 


■ ScOOO 


'program origin 




FP 


1590data255, 173, 9,192, 32,177 


UA 
CD 


150 ; 

160 .constenia 








Dl 


1600data255,169,111, 32,147,255 


1 AO 
' AH 


170 ; 
180 llBt 


- S9b 


;liat tokan val 




01 


1610 data 32,135,192,134,253,132 


IMF 
: FK 


190 pfinT 
200 illquan 


= *99 
■c SOfl 


;prinl token val 
narrcr values 




DK 


1620 data 254, 170, 160, 0, 177, 253 


JL 
EO 


210 aynl&x 

220 afaTus 


-«0t> 
-$90 


^ 

.Status byre 




AK 


1630 data 32,168,255,200,202,208 


AF 


230 commB 


4 W 
> 


;aaciiol comma 






r 1 r F 3 


OE 


240 colon 


^ ■ r ■ 


:a£cii ol colon 




Gl 


1640 data 247, 76,174,255,169, 


PB 


250 eol 


= 


^^^m ^^ ^^ ^^ 

.andof Line 




EC 


1650 data 133, 253, 32, 75.193, 32 


HF 
GD 


260 Slack 
270 kaylatile 


- soioo 


,E»ttnrnG5xx»th 
;hayword labia 




CN 


1660 data 207, 255, 32,207,255,169 


01 
KM 


260 - 

290 '. Inlerpr^sr roulinss uasd 






LI 


1670data 0,141, 11,192,169, 13 


CK 
DK 


300 L 
310 chrgal 


- 10073 


,get naxtohar 




HN 


1680 data 32,210,255, 32,207,255 


OE 

EL 


320 chrgol 
330 rea<V 


- 10079 

■. £a474 


.get laar char 
,10 'ready 




KP 


1690 data 32,207,255, 32,207,255 


CB 
AK 


340 acannexi 
350 nia^p 


-«fi9oa 

- Sad9a 


;10 n&KT slalBmanl 
;avalgenavp 




MN 


1700 data 133, 253, 32,207,255,133 


BD 
HB 


360 looJtup 
370 intfn 


- SbOBb 

- Sb39i 


; variable 
;lm->nr conv. 







1710data254, 32,183,255,240, 3 


FK 
BP 


3S0 strres 

390 ifiscid 


- Ib475 

- Sb6a3 


:res spc 4 siring 
'unwanted string 




BC 


1720 data 76, 67,193,165,254,164 


AB 
FK 


400 Bkp 

410 maac 


-Sb7ri 
-ibdcU 


.int expinx-rAg 
,flt->aflciiconv 




ED 


1730dala253, 32,145,179, 32,221 


KB 
□B 


420 , 

430 ; Kornal routines used 






HB 


1740data189, 160, 1, 185, 0, 1 


OC 


440 : 












HD 


450 CtOM 


- $flc3 


^opened file 




HF 


1750data240, 6, 32,210,255,200 


JN 


460 chkln 


- «ffc6 


^aai input 




IB 


1760 data 208, 245, 169, 32, 32,210 


HH 


470 chtoul 

460 Htlfs 


■ «fld2 
-Sflbe 


.outpur Id fila 
.sat log lean, Z 
; open file 

isal Ilia name 




NF 


1770 data 255, 32,225,255,240, 52 


00 
BJ 


490 open 

500 Mtnam 


- IflcO 
= Ifibd 




MA 


1780 data201, 239, 240, 247, 32,207 


HC 
BB 


510 readst 
520 chrln 


- Sflb7 
-$ncf 


;get Blalus 
inat trcm device 




HM 


1790data255, 240, 180, 48, 20, 32 


PL 
DG 


630 Clrchin 
640 Slop 


- Sflcc 


,cleari/o 
.acanafop 




EC 


1800data210,255,201, 34,208,233 


LH 
LC 


650 lalk 
550 Iksa 


-$m>4 

- Ift96 


, send lalk 
^aendsarorlallt 




LG 


1810data238, 11.192,173, 11,192 


KK 
LD 


670 untalk 
530 acprr 


- SflaD 

- £ffa5 


.send urT[dLk 
:ge[ serial byte 




LC 


1820data 41, 1, 141, 11, 192, 16 


NM 
MF 


$90 llatan 
600 lansa 


- Sffbi 
-Sfl93 


,send lESten 
-send 3a - hBien 




JO 


1830data220, 174, 11,192,240, 6 


EK 
GA 


610 unlsn 
620 cioul 


- Sflaa 

- SNa6 


^aand unliaten 
;aand aarlal byla 




Ml 


1840 data 32,210,255, 76,207,193 


MO 
Jl 


630 : 

640 , ram indirBCl veclOra all«i«d 






KH 


1850data201,255,240,246, 32, 11 


AA 


650 ; 










1 r r F F 


EN 


660 Lsrror 


- £0300 


; errors 




LF 


1860 data 194, 76,207,193, 76, 67 


FE 


670 iload 


- £0330 


;ioads 




JP 


1870 data 193, 160, 0, 56,233,128 


HF 
IC 


660 kuvt 
690 , 


- £0332 


,aavea 




NJ 


1880dala240, 15,170,169,255,200 


BC 


700 , z9to page uead 
710 ; 






KE 


1890 data 185, 158, 160, 48, 2, 208 


JK 


720 varaddr 

730 flaccl 


- S49 
-S61 


laddrataoTvar 

■m.pt-acc. »1 




HK 


1900 data248, 202, 208, 245, 200, 185 


OE 

PN 


740 curlin 
750 curcMv 


-£39 
- £ba 


;curr«nr line 
:currem device 




ON 


1910 data 158, 160, 48, 6, 32,210 


IN 
IH 


760 Wmp 
770 ; 


■ £fd 


ntamp atorage 




AK 


1920data255, 200,208, 245, 56,233 


LP 
Ml 


780 
700 ; 


jmp start 


;around alofage 




01 


1930 data 128, 76,210,255,169, 2 i 


CO 
AK 


8O0 , genaral msmory atoraga 

aio , 






GE 


1940 data 133, 253, 32, 75,193, 32 


KJ 


820 errvflctor word 
830 loadvaclor wordO 


;Dld err vector 
;old!oad * 




NN 


1950 data 207, 255, 170, 32,183,255 


HK 


840 savaveclor .^ordC 


.oidsavs ' 






1 


CJ 


650 curdavnum -bvta 6 


,daiauii davica# 




MA 

1 


1960data240, 3, 76, 67,193,138 


MJ 
KM 


360 mychar 
870 qixjlflflag 


asc @ 

byteO 


;arrwedgachBr 
.boolean 




■ HP 


^1970data 32,210,255, 32,225,255 


GH 
AP 
KG 


aeo Wmp&Ir 


. - , + 40 


,3pace For airing 




J lA 


1980 data 208, 3, 76, 67,193,201 


900 slarl 


■ d 






DB 


1990 data 239, 208, 228, 240, 242, 173 


EA 
IK 


910 ; 
920 


Ida terror 


;altef vaclora 




MG 


2000data 9,192, 32,180,255,169 


M^i 
FB 


930 
940 


ata flrrvector 
Ida lerror + 1 


;in ram lo r>ew 
^foutmas 




BL 


2010data111, 32,150,255,169, 


CG 
CO 


950 
960 


sta flrfvacTor + 
Ida '< anarfof 


1 :aava ihe old 
>aluaft. 




DF 


2020data133, 144, 32,165,255, 32 


OF 

ID 


970 
980 


Ids ■> OFiflmJr 


;rfl-dlrecl lo 
;nawroulina3 




PB 


2030 data 210, 255, 32,183,255,240 


MC 
BM 


9B0 
1000 


sta i^rror + 1 
Ida isave 






FA 


2040 data 245, 76,171,255,173, 9 


LP 
HJ 


1010 
1020 


Sta SAvevector 
Ida isava 4- ^ 






MF 


2050data192, 32,180,255,169,111 


BN 
Kl 


1030 
1040 


ata aavevaclor -i- 1 
Ida '< satsave 




EO 

1 


2060 data 32, 150, 255, 169, 0, 133 


BD 
KJ 


1050 
1060 


sla i3av« 

Ida #> sataava 






HG i 


2070 data 144, 168, 32,165,255,153 


hA 
PA 


1070 
1030 


ata laai^e -h ] 
Ida iload 






PF 


2080 data 12,192,200, 32,183,255 


1 f^ 

KE 


1090 


Sta loadv»cTor 






LK 


2090 data 208, 4,192, 40,208,240 


FO 
AC 


1100 

ino 


Ida Iload -i- 1 

ata loadvector -i 


' 1 




JL 


2100 data 32,171,255,136,152, 72 


PH 


1120 
1130 


Ida #< satlchad 
9ls iload 






PF 


2110dala 72, 32,115, 0, 32,139 


10 
FF 


1140 
1150 


Ida §> »tload 
ata Ibad + 1 






CB 


2120 data 176, 133, 73,132, 74, 32 


EH 
lA 


1180 
1170 ; 


na 






OH 


2130 data 163, 182, 104, 32,117,180 


NF 
MB 


1 130 sfltsave 
1190 ■ 


■ * 






EH 


2140data160, 2,185, 97, 0, 145 


DO 
AK 


1200 
1E10 


Idk curdavnum 

atx curdQv 






NK 


2150 data 73,136, 16,248,200,104 


KA 

EE 


1220 
1230 : 


Jfnp {aavavactor) 






NA 


2160data170, 185, 12,192,145, 98 


IJ 

rp 


1240 aatloBd 
IPSO ; 


^ * 






MJ 


2170data200, 202, 208,247, 96 


PB 

MN 

EE 

Al 


1260 
1270 
1280 
1290 : 


kiK curdavnum 
fttJc CLirdav 
)mp (laadvecTor) 














DJ 


1300 getslnng 


J* ■ 








CM 


1310 : alrlnglnpulanddiscard 








KE 


1320 


tar chrg&t 








FN 


1330 


)ar niaxp 








MK 1 1340 


)mp diacrd 





TtM T^niactor 



24 



Volume 5, lif ue 06 



ML 
BA 
MN 
EC 

10 

M 

IP 

PA 

MA 

OL 

EC 

DB I 

GE 

00 

FA 

CF 

KG 

Lh 

IC 

El 
DJ 
U 
KH 
JC 

IB 
Hf 
ON 
NJ 
HD 
CP 
PP 
GA 
DE 
FH 
EC 
DNi 
ID 
EG 
JF 
GF 
EB 
DE 
HK 
AJ 
FM 
FD 

Ul 
AC 
AD 
EM 
CA 
^N 
LJ 
EB 
GP 
10 
KA 
LE 
OB 
JP 
DE 
BJ 
GE 
BK 
KF 
HJ 
BM 
IH 
KB 
Ml 
NJ 
EJ 
KK 
HB 
HJ 
CD 
GA 
EL 
LD 
BJ 
BB 
HG 
CG 
HL 
ID 
Nl 
MK 
AE 
FO 
EF 
00 
OF 
CH 
MN 
CC 
AJ 
kD 
EK 
CI 
DC 
OK 
UU 
JA 
CN 
KO 
DK 
OP 
OK 
JN 

Me 
JN 

AD 
AC 
EE 
BO 

IF 

ML 

FF 

LL 

GJ 

IB 

KK 

KE 

ND 



t350 
1360 
T370 
1360 
1390 
1400 
1410 
1420 
1430 
144Q 
1450 
1460 
1470 
"480 
1490 

1500 
1510 
1520 
1S30 
1540 
1550 
1560 
1570 
I5fl0 
1590 
leOD 
161Q 
1620 
1G30 
1640 
1650 
1660 
1670 
1680 
1690 
1700 
1710 
1720 
1730 
1740 
1750 
1760 
1770 
1780 
1790 

laoo 

1610 

1B20 

1830 

1840 

1850 

1860 

1870 

tSBO 

1690 

1900 

1910 

1920 

1930 

1940 

1S50 

I960 

1970 

19B0 

1990 

2000 

2010 

2020 

2030 

2040 

2050 

2060 

2070 

2080 

2090 

2100 

21 !0 

2120 

2130 

2140 

2150 

2160 

2170 

2180 

2190 

2200 

2210 

2230 

2230 

2240 

2250 

2260 

2270 

2280 

2290 

2300 

2310 

2320 

2330 

2340 

2350 

2360 

2370 

2380 

2390 

2400 

2410 

2420 

2430 

2440 

2480 

2460 

2470 

2480 

2490 

2600 

2510 

2520 

2530 

2540 

2650 

2560 

2570 

2580 

2590 

2600 

2810 



onefror ■ * 

, ihiB IS If lofks 

cpx 

beq 

imp 



ngrilype 



FTiysriar 



|sr 

CI"P 

Eiaq 
imp 



p<fl 

pla 

Jsr 

jmp 



ric]li[ype 
(errvficfor) 



chrgor 

mychar 
my error 






isluff 

.give bach to bdSK 



.^harlartdsw^el ain't II 



pars? - ♦ 

, command pars&r 



show 



jsr 

Cmp 

beq 

cmp 

beq 

bne 



JBr 

imp 



chrgel 

#eol 

show 

#coloo 

show 

nexll 



shQwdS 



-fl^lraighl character 
-by character sflarch 

;th rough basic taxi 
^to Klaniily cDTTimand. 
.not elegant, bul 
;runcticnal 



nexn 



other 1 



cmp 
bria 

pha 

isr 

pfa 

cmp 
bne 

|sr 
atip: 



cmp 

bne 



naxt2 

cfirget 
scan 

OlhflFl 



exp 
curdavnum 



^command starl wilh a 
;"d" nO">trvanolhflr 

"cfiFTimand sians with 
/d" 



:check second char. 



othar2 



,sei new default 
^device numtjar. 



,[ry anolher seccnd 

icharacrar 



Jmp doacomm ;3end das command 



olher2 



cmp 
beq 



dsluhc 



jrnp (flrrvflctor) 



dflfuhc 



ne:<ie 



jsr 
imp 



cmp 
bna 



Ida 
sla 
Ida 
ala 
Ida 
&ta 
Ida 
Sla 
Ida 
fila 



scan 
mpgtds 



nexta 

scan 

affveclOT 

ierror 

□rrvecTor 

lerror + 1 

savavector 

isava 

savavaclor 

laave + 1 

loadveclor 

iload 

loadvflciof 

iicad + 1 



;lael chance 4 command 
,sla'lmg witha "d"' 
.invalid command 



jnputdlskslaTua 



+ 1 



.kiH utility 
,1 a raslore 
;0ri3inal veclora 



-h 1 



naKr3 



neHl4 



cmp 
bne 



,5r 
imp 

= w 



«lisl 

nBi<|4 

Kan 
dolist 



, print laHl I'M 

cmp 
bne 



rnaisail 



(rrp 



imp 



#prim 
ihalsall 

scan 
doprlnl 



#aynrdx 
(errvectof) 



;lli( progfBm or 
.direclory foufina 



,rtiii(ine 



scan 



jar chr^t 



scan mo re = 



cmp 

Mq 

cmp 

baq 

cmp 

t»q 

IS' 

jmp 



Icomrna 

out 

-colon 

oul 

chrgflf 

sceniTiDre 



,lh a[ 'sail for nowi' 
,real syntax erioi 



;gal laat character 



.atripoul antra 
item exit nn eol 
icommaoi colon 



CL 
hJD 
GNi 
GE 
KN 
BL 
OO 

El 

OF 

GP 

GG 

LO 

KC 

JD 

Jt 
CG 
HG 

KL 
OG 
PL 
PO 

01 

JO 

CK 

EC 

MC 

OH 

JD 

Kl 
AM 
CtA 
C? 
GJ 
GA 

IN 

IB 

IN 
OC 

m 

HL 
ME 
IK 
KO 
CH 
Al 
IB 
II 

lO 
^J 
MA 
PH 
MD 
KO 
EB 
OE 
Dl 
BC 
FJ 
BE 
NP 
FO 
HA 
JK 
JA 
MK 
DJ 
HC 
KF 
AL 
OG 
HI 
IB 
NO 
AA 
EA 
KK 
LA 
OL 
JF 
KL 
MN 
GA 
AP 
BF 
FE 
FF 
PI 
GL 
GC 
MJ 
ML 
PM 
BH 
JB 

CP 

IH 
EO 
HC 
AJ 
IJ 
EK 
IF 
NA 
CM 
IB 
GN 
CK 
AL 
EP 
GO 
lA 
MP 
EJ 
JO 
GP 
KD 
BG 
PE 
HE 
CG 
CO 
GH 
OB 
FJ 
AO 
CK 



2620 

263CI oul 

2640 

2650 

2660 

2670 cloMinpul 

26B0 , 

2690 

2700 

3710 

2720 : 

2730 opofiinpui 

27-10 , 

2750 

2760 

2770 

27B0 

2790 

2600 

2810 

2B20 

2630 

2840 : 

2850 dciscoinm 

2660 ; 

2870 

2860 

2690 

2900 

2910 

2920 

2930 

2940 , 

2950 disMp 

2960 , 

2970 

2960 

2990 

3OO0 : 

30tD , 

3020 dDliSt 

3030 ; 

3040 

3050 

3060 

3070 

3060 

3090 , 

3100 tJirlOOp 

3110 , 

3120 

3130 

3140 

3150 

3160 

3170 

3180 

3190 

3200 

3210 

3220 

3230 

3240 

3250 

3260 

3270 

3260 

3290 

3300 ; 

3310 proutnum 

3320 , 

3330 

3340 

3350 

3360 

3370 

3380 , 

3390 adaapace 

3400 , 

3410 

3420 

3430 ; 

3440 dirline 

3450 ; 

3460 

3470 

3480 

3490 

3500 

3510 

3520 

3530 

3540 

3550 

3560 

3570 

3530 

3590 

3600 

3610 , 

3620 iskev 

3630 , 

3640 

3650 

3660 , 

3670 Oonldok 

3680 . 

3690 

3700 

3710 ; 

3720 dokey 

3730 , 

3740 

3750 

3760 

3770 

3780 , 

3790 d^rend 

3300 . 

3H10 

3B20 . 

3B30 hslkey 

3840 . 

3650 

3860 

3870 

3880 



ris 



I clic-Hn 
aa #137 
jmp cloaa 



r. 



Ida 
Idx 

&r 

ax 

imp 



gelslFJng 
setnam 
lemp 
#1?7 

curOevnum 

sellts 

ope-n 

chhir^ 



.close 3n input 

.^^1e 



.open input nie 

.oaf Mcondary 
,file# 127 used' 



tda curdevnum 

ellsren 
a fSfir 
fir Isnaa 
]sr gelsifing 
slxf&rtip alytemp 
Ian lcly#0 



gel device nurriber 
reir it to listen 

ser = (ioiorifio) 

hsien secondary 
.get command sinng 

+ 1 



isend cornmand 



lda(leiTip),y- jar clou! 
Iny deT< ■ bnedisMp 
ynp unken 



Ida 
9la 

fit 



lemp 

open Input 

chrin 

chr^n 



Jda #0 

ala quolenag 

chroul 

chnn 

chnn 

chnn 
3 lamp 

chrin 
3 lemp + 1 

readsl 
iq ^ + 5 
ip close input 
a temp + i 
V temp 

intfll 
' niasc 
^ #1 



Ida 

beq 
jsr 
Fny 
bne 



slack ,y 
adclspaca 

cl^rgul 

proutnum 



Ida «^ ' 
jar chroul 



jsr 
Mq 
cmp 
baq 

E. 

Oml 

jsr 

cmp 

bne 

inc 

Ida 

and 

sui 

bpl 



srop 
dir&nd 

#^f 
dirline 
chrin 
diEloop 

chroul 

#34 
diilins 
quoTeHfig 
quale flag 

#1 

quolellag 

dirlina 



Idx quptelag 



'fit cFiroul 
jmp dirllne 

cmp #355 
beq donldok 
lai hslkey 
jirp dirline 



:close tile 
jmp cBseinpul 



Bbc *t80 
t»q pdiey 



igivHsecandary of 
jiwesEe atari adOraaa 



;lnlliall2« quels 

;mode 

;aend a relurn lo Ihe 

iScraan 

,wesTe polnlera 

,Qai#<blcKkcouni 

/iFrrenum 

;gHl #> block counl 

;enflolflle"7 
;na ■ > gel more 
;yeB - > flifll 

.canverT intsger prg. 

,9izfl 10 noatlng 

.poinl 

;convHrE floar-ascil 



»prinl out ascii 
,9lring from slack 



, pa d eur ic Improve 
;af]paarance 



;cfiBckfrjr3lDpkey 

;yes ■ > qml 
^checkFer 3{>ecebar 

;yea ->paiise1isl 

;gel resi o1 line 

;tn|7afll->rokBii '7 
;no[ loksn, print it 
;was It s quote print 
,no =>ct>minue 
,yes => quota moOB 
,ie toggle 
.boolean quotellag 

:bianch always 



.quDtemode "? 
,yes 5>pfin(loken 



;no ■>shifledchar 
;rHturntelaop 



■is a pi 

^nol in taken list 
;reluin to loup 



»loken in ace 

inorrriallfs lohen range 
.too- 127 



NP 

JP 

ML 

Ml 

AN 

ML 

HK 

AK 

OJ 

DE 

CL 

Al 

AC 

DD 

ED 

FC 

FD 

JE 

LH 

EA 

AH 

AJ 

El 

NO 

PB 

FK 

MK 

Lx; 

AM 
LG 
JP 

01 
lO 

Hi 

MP 

LM 

AP 

lA 

HM 

JP 

MD 

H8 

ME 

DE 

AB 

IP 

LP 

PH 

CN 

LA 

MD 

GK 

AE 

KD 

IF 

Hf4 

GM 

DF 

OK 

GP 

Ml 

KA 

Fl 

HD 

IB 

FG 

GE 

HN 

OK 

MN 

HH 

GG 

OP 

OH 

PO 

AK 

BB 

EL 

PC 

MG 

BO 

IL 

Bl 

KK 

KP 

CM 

OA 

LF 

CC 

BL 

GD 

EK 

FL 

FL 

EH 

FG 

LH 

KC 

IK 

JG 

KJ 

FL 

OK 

GG 

ID 

as 

JK 
LH 
NN 
EP 
FB 
lA 
OA 
HF 
Bl 
FC 
AL 
EE 
EL 
CO 



3090 mx 

39D0 kj3 nn 

3010 , 

3920 Bckeylab - - 

3930 . 

394D 

3950 

396D 

3970 

39B0 

3990 

4000 

flOlO ; 

4020 prkey 

4030 , 

4040 

4050 

4000 

4070 

4oeo 

4090 , 

4100 endprkey 

4110 : 

4120 
4130 
4140 

4150 , 

4160 dopnnf 

4170 , 

4iao 

4190 

4200 

4210 , 

4220 Il8lk»p 

4230 : 

4240 

4350 

4260 

4270 

4280 

4290 

4300 

4310 , 

4320 lislcMlay 

4330 ; eMeuldwepauM "7" 

4340 jsr stop 

4350 bnfl . + 5 

4360 jmp ckiselnpuE 

4370 cmp #Sel 

4380 bne llslleop 

4390 beg Latdaiay 

4400 , 

4410 ahowdB - ■ 

4430 , atiow disk slalus lo scre«n 



iny 

Ida keyrarjJe,y 

bmi . + 4 

bne sckeylab 

de> 

bne sckeyteb 

my 



Ua heylable.y 

bmi endpfkey 

jsr cfiroui 

my 

bne prkey 



BBC 

Bbc jfsao 
jmp chroul 



Ida V2 

ala temp 

jsr openinpul 



jsr chnn 

tax 

\si readsl 

beq ■ + 5 

^p q^eaelnpul 

ixa 

Isr chrouf 



:gei lo rhe light 
.taken in rlie 
.table 



4030 

4440 

4450 

4460 

4470 

44B0 : 

4490 dsloop 

4500 , 

4510 

4520 

4530 

4540 

4550 

4560 ; 

4570 inpulfls 

4580 '. 

4590 

4600 

4610 

4620 

4630 

4040 

4650 . 

4660 nJsloop 

4670 . 

4&Q0 

4690 

4700 

4710 

4720 

4730 

4740 , 

4750 outrds 

4760 . 

4770 

4780 ; 

4790 , stcreitoul 

4B00 , 

4S10 

4620 

4630 

4640 

4650 

4860 

4870 

4860 

4890 

4900 ; 

4910 Store 

4920 , 

4930 

4940 

4950 

4960 

4970 

4960 

4990 , 

5000 transler 

5010 , 

5020 

5030 

5040 

5050 

5060 

5070 . 

5060 and 

5090 end 



Ida curdevnum 

jsr talk 

Ida vser 

&[|isa 
«0 1 sla BtdluB 



floptr 
chrout 

q dak)op 
jmp umaik 



jsr 
|sr 



Ida 
lor 
Ida 
lar 



Curdevnum 

Iksa 
lda"Ci ^laaiaiua 



)Br acpir 
sla tempBlr.y : Iny 
isr readal 
bne oulrda 

brw rdatoop 



l&f unialk 



,1gund II now 
:prinE il iXil 

.laalcha racier 
.oHaksn in tflblfi 
.hasbil7 5e1 



;un shift last char 
;prin| and rarurn 
.allar chroul 



;u3e secDndafy 

;oriwo 

^openlhafil? 



.gaT character 
.^veiriKrag 
.chackds 
,Mt don4 
,dona 

.fivflrthhng ok 
^Ihsri prihl rt 



;ctl«ik lor stop 
inopa ■ > mcrA 

; IS II spacebar 
;no ->flotiack 
,yfls ->mcre delay 



;gHl drive nurnbar 
^lalktomedfF^a 
;$BI*(SOforSeO] 
-sern) secondary 



, gel serial 

.pnnlil 

, check ST 

;ok ■>dO!nefft 

;shuf up drive 

iraaddiskslaTus 
& assign lo var 
.gel device number 
;talk Xo me drive 
.S6f = (SOforSeO) 
; send secondary 
.force zero 



;geE serial 
;Save lampair 
Xhech St 

,no =>exit 
;Hrnl1lenglh 
,|q 40 CherS. 



,sh^i tip drive 



deyilyaipha pNa 
]sr chrgel 
jsr k>okup 
sTa varaddr 
sly varaddr + 1 
jsr diflcrd 



Id 



sr 



slrres 



Ida llaoci ,y 

sla [veraddrl.y 

day 

bpE store 

my 

pla' tax 



Ida teiTipsTrny 
Sla lllflcci + 11. 
tny . dex 
bne Iranafer 
ft* 



:sAve len iwlce 
.advance rexlplr 

.lookup var 
,sl&re address 

;ge1 nd E>r It 
.remember ler>gth 
;resBn/e space for sir 



;3 byf ea are 

; length 5 address 



;Bet y TO 

;rerT^ember ter^gth again 

.from lamp lo var 



Th«TronMi£tor 



25 



Volume 5^ l»ii# 06 



The Commodore 64 
Keyboard Part 2: 



Aubrey Stanley 
Mississauga, Ont. 



KEYWIZARD - An Amazing Keyboard Driver 

Key Wizard is an alternative to the Kernel Keyboard Driver which 1 
described in Part 1 (last issue). Bui it is more than just a driver. Many 
other features have been added, it will literally bring joy to your 
fingertips! 

Part 2 is for everybody. It describes the functions and gives the BASIC 
[x»ader. It is a long program, so typing it in may be a chore. However, 
with the new listing format in The Transactor you should be safe from 
errors, 

(n Part ^ I will be presenting the source. 1 intend to build more 
functions into this program to suit my own particular needs. Tm sure 
many of you will wish to do the same. If you have any good ideas and/ 
or source for some really useful routines, please submit them to the 
TRANSACTOR. 

The Key Wizard system gives you true N-KEY ROLLOVER capability. 
This means that keys are displayed as they are pressed even if 
previous keys have not as yet been released. The 'N' factor can be set 
by the user to any value. But remember that the Commodore key- 
board matrix often generates false values when three or more keys are 
pressed together. For this reason it may be desirable to leave this 
count at 2. its default setting. Even a 2-KEY ROLLOVER vastly 
improves the productivity of keyboard input and allows you to repeat 
the two keys pressed; for example, when you wish to scroll the cursor 
diagonally across the screen using Cursor Down and Cursor Right 

Key Wizard is totally transparent to software that uses the standard 
driver for keyboard inpuL The interface is identical to that of the 
standard driver, i have used it with development packages like 
'POWER', 'MOREPOWER' and 'PAL' to further enhance the speed and 
ease of program development. 

In a standard memory configuration using BASIC, Key Wizard needs 
only 24 bytes of memory which may be located at any suitable 
address. Normally, Key Wizard uses the address range from 53224 to 
53247 ($CFE8 to SCFFF). The rest of the program is tucked away in 
the normally unused block of RAM behind the BASIC ROM. There- 
fore, adding functions to this program will not take away from the 
useful memory space. 

Key Wizard is an invaluable keyboard driver for program develop- 
ment as it greatly enhances the editing capabilities of the standard 
screen editor. Multiple features have been built into the program and 
the potential exists to incorporate many more. For complete flexibil- 
ity, the user is allowed to map his own routine to any key. 

For those who would like to rearrange the keyboard, Key Wizard 
allows each and every key to be re-configured (except for the Control, 
Shift and Commodore Keys). Change one or two keys, or the entire 
keyboard for that matter. (Con you say. 'Dvorak"? KJH.) 

Assigning keys to strings is another capability built into the Key 
Wizard system. Map your most used BASIC keywords, commands, 
etc, to keys of your choice and have them displayed when the keys are 
pressed. 



Changing the colour of border, background or text can be done by 
hitting a key with Key Wizard. Cycle through the combinations until 
you find one that suits you besL 

Key Wizard allows you to save your keyboard profile on diskette after 
you have mapped the keyboard to your own particular requirements. 
More than one profile may be saved, tobeloaded in at any future time 
when needed- 

The BASIC Loader 

the Key Wizard system is provided in the form of a BASIC Loader 
program called ''KEYWIZ-64", This program does the following: 

t. Puts the Key Wizard machine-language into memory. 

This is the only step that is performed when the program is simply 
RUN. As listed, the machine-language program is POKEd into mem- 
ory from the DATA statements in two separate blocks: 

(a) LINES 200 and 201 contain the IRQ Vector Entry Routine, 24 bytes. 
Normally this is loaded into location 53224, But since it is totally 
relocatable, you may wish to move it to some other location. To do so, 
simply assign the new address to the variable T in LINE 52. Also in 
LINE 52 is the value of the N-KEY ROLLOVER count, NK. This is 
assigned a value of 2. You may change it to any value, but remember 
that the Commodore Keyboard hardware can give false values when 
more than two keys are pressed simultaneously. For this reason, 1 
would leave the value at 2. 

A word of warning for 'POWER" users, I found that relocating the 
program in the Cassette Buffer interferes with POWER'S String Search 
facility. 

(b) LINE 300 on contains the Key Wizard machine-language pro- 
gram, 2,5K bytes. This is loaded behind the BASIC ROM, starting at 
41216{$A100). 

2. Saves Key Wizard on dlsketle. 

The routine at LINE 70 will save the Key Wizard machine- language 
program to disk as a program file (this is done after execution of Key 
Wizard's save function as explained later). Saving the program as a file 
reduces the loading time the next time KEYW12-64 is run, since the 
machine- language program need not be POKEd into memory from 
DATA statements, 

3p Saves your Keyboard Profile on diskette. 

After you have rearranged the keyboard, defined strings, etc, you may 
save the keyboard profile permanently on diskette using the routine at 
LINE 80. 

Loading The Program And Keyboard Profile 

First, use KEYWIZ-64 to save the Key Wizard machine-language 
program on diskette. If you have not not yet done this, refer to the 
section on Saving The Program, This will considerably reduce your 
loading time in the future. 



Th« Tronsactor 



26 



Volu me 5r luue 06 



LINE 50 tells KEYWIZ-64 how to go about loading the Key Wizard 
system. There are two variables associated with this process. TBS' is 
assigned the KRYBOARD PROFlhR name, and ^PG$^ the PROGRAM 
Name. Initially TB$ = "KERNEL' and PG$="KPRG". These default 
values tell KEYWlZ-64 that (a) the standard keyboard arrangement as 
provided by the KERNEL is to be used {as opposed to 3 profile from 
disk) and (b) to load Key Wizard from the DATA .statements in lines 300 
onwards rather than from a disk file. This is the set-up used the first 
lime KEYWIZ-64 is run; after that, the Key Wizard machine-language 
program is loaded from a disk file. 

if you assign any OTHER name toTB$ in LINE 50, then KEYWIZ-64 
will load the Keyboard Profile from disk using TBS as the filename. 

\t you assign any OTHER name to PG$ in LINE 50. then "KEYWIZ- 
64" will load the Key Wizard machine language program from disk 
using PG$ as the filename. 

L 

Once you have saved the program on diskette, you should modify the 
value of PG$ in LINE 50 to the saved name. Then you may delete 
Lines 300 onwards as they will no longer be required. You'll need the 
routines at the beginning of KEYWIZ-64 to make new keyboard 
profiles - eliminating all those unnecesary DATA statements will 
considerably reduce the loading time. You should make a Backup 
Version of KEYWIZ-64 before you start to modify iL 

If you do not have a utility to delete BASIC lines automatically, I would 
suggest that you save KEYWIZ-64 after you have entered all lines up 
to Line 300. After entering the remaining DATA statements, save 
"KEYWIZ-64 W/DATA" as a BACKUP version on another diskette. 
Finally, follow the instructions (below) to save the machine language 
for Key Wizard as a program file on the diskette that contains your 
original, shortened version. From then on use your short version. 

Saving The Program And Keyboard Profile 

After the loader is RUN once, the Key Wizard machine-language 
program can be saved as a PRG file on disk. 

The name of the PROGRAM file under which the Key Wizard 
machine-language proi^ram is saved is assigned to the variable PGS 
in LINE 72, 1 have used "the name "KWIZ". You may change this to any 

other name if you like. Then type: 

CONTROL and SPACEBAR 

Each time you type this command. Key Wizard will copy either the 
Program or the Keyboard Profile into the memory area beginning at 
49152($CO0O), So be sure that you do not have anything running in 

this area when you enter this command. Key Wizard will display an 
appropriate message to tell you which operation was performed. So if 
you see the message, "SAVE TB", you should then enter the command 
again and "SAVE PG^' will be displayed the next time. Key Wizard 
alternates between the two each time the command is entered. Type: 

RUN 70 

and the Key Wizard machine-language program will be saved on 
diskette. 

The name of the KEYBOARD PROFILE under which the tables are 
saved is assigned to the variable TBS in LINE 82. 1 have used the name 
"KWIZTB". You may change this to any other name if you like. Then 
enter the above command until you see the message, "SAVE TB", 

Type: 

RUN 80 

and the current keyboard profile will be saved on diskette. 



Now save the shortened version of KEYWIZ-64 (LINES up to 250) 
with the new assignments for PGS and TBS. Each time this program is 
RUN, the Key Wizard program will be loaded from disk directly into 
memory. 

You may wish to save a variety of Keyboard Profiles to suit different 
applications. Remember to use different names in this case and to 
assign the desired name to TBS in LINE 50 before running KEYWIZ- 
64. 

r 

To recap the use of the BASIC KEYWIZ-G4 program: the first time you 
run the program, it should be used in exactly the same form as it 
appears in the listing. When RUN, it will place the Key Wizard 
machine-language program and default keyboard profile in memory. 
After that, a new version of "KEYWIZ-64^' can be created, one without 
the DATA statements (lines 300 to end), and with the assignments in 
hne 50 changed to; 

tb$= "kwiz.tb'; pg$= "kwiz" 
(assuming the default filenames) 

This new version will be used in the future to load and enable The Key 
Wizard system, but first the Key Wizard machine-language program 
and keyboard profile must be saved to disk. 

The Key Wizard machine-language program is saved to disk with: 

CTRL/SPACE, then RUN 70 
and the current keyboard profile is saved with: 

CTRL/SPACE, then RUN 80. 

(The CTRL/SPACE combination acts as a toggle and alternately 
commits the program or the profile to memory where it can be read by 
the save routines) 

Changing The Screen Colours 

The Screen Colours may be changed to any ot the 16 standard colours 
by using the following commands: 



CONTROL and HOME 
CONTROL and DELETE 
CONTROL and RETURN 



for Border 

for Screen 

for Text 



Use a particular command repeatedly until the desired colour is 
displayed. THESE COMMANDS ONLY WORK IN DIRECT MODE, 

Repeal Mode 

In repeat mode, all keys are repeated in both Direct and RUN mode. 
To toggle repeat mode, use: 

CONTROL and SHIFT 
Normally repeating keys (Cursor, Spacebar, etc) are not affected. 
Alternalive INSERT/DELETE Mode 

The alternative Insert puts the BASIC editor into a permanent "insert 
mode", where space is automatically opened up in text as characters 
are entered. In other words, all characters to the right of the cursor 
move forward as you type, until the BASIC line is full {80 characters 
long). 

The alternative Delete function uses the DELETE key to delete the 
character under the cursor. All characters to the right of the deleted 



Th« TranMictor 



27 



Vb1um« 5, l55ue 06 



position, up lo the end of ihe BASIC Line, are aulomatically moved left 
by one posilton. To delete to tfie end of the BASIC Line, just hold down 
the DELETE key until all the characters are erased. 

This mode is toggled on and off by successive entries of the keys: 

CONTROL and COMMODORE 

THIS COMMAND MAY BE ENTERED AT ANY TIME, BUT THE 
ALTERNATIVE INSERT/DELETE MODE WILL ONLY BE IN EFFECT 
DURING DIRECT MODE. 

Stringfl 

You may assign a siring lo a key or "undo" a previously defined string 
by entering the command: 

CONTROL and CURSOR DOWN 

Key Wizard will display the message: 

STRING? 



U»er Routine Keys 

You may assign a User Routine to a key or undo a previously assigned 
routine by entering the command: 

CONTROL and RUN STOP 

Key Wizard will display the message: 

USER? 

Use RETURN to abort, otherwise enter the key you wish lo have 
assigned or lo undo. Hit RETURN lo undo an assignment or else enter 
the start address of the User Routine in Hexadecimal. A 4 character 
address is mandatory. The assigned routine will be automatically 
started whenever the key is pressed. 

You should bear in mind that the User Routine runs within the IRQ 
Interrupt- This facility allows you lo develop your ov^n editing, or 
other suitable, routines and then plug ihem into Key Wizard. Return 
to Key Wizard by using an "RTS" instruction with register "X" 
containing any standard ASCII keyboard code you may wish to have 
displayed or actioned. If you do not wish to pass back an ASCII value 
then set "X" to the value, SFF. 



In case you have entered the command in error, type RETURN to 
abort. Otherwise enter the key you want lo make into a string or to 
undo from a previous assignment- All values are permissible - 
normal, shifted. Commodore or control. There are some restrictions, 
for example you cannot assign a key that has already been assigned to 
some other function like a Re-configured Key or a User Routine. The 
key you enter will replace the '?' prompt and an ' = ' sign will be added. 
eg.> 

STRING I = 

Then enter a string or else type RETURN if you wish to undo a 
previously defined string. The string may be up to 32 characters. Use 
the RETURN key to terminate the string. If you wish to include a 
RETURN within the string, then type a 'SHIFTED RETURN'. This will 
cause a new-line on the screen, tiut will not terminate the string. 

UP TO 32 STRINGS MAY BE ASSIGNED. A STRING WILL BE DIS- 
PLAYED WHEN ITS KEY IS PRESSED. BUT ONLY IN DIRECT MODE. 
IN RUN MODE, THE VALUE OF THE ORIGINAL KEY, NOT THE 
STRING, WILL BE PASSED TO THE PROGRAM. 

Re-Configured Keys 

You may re-configure a key or "undo" a previously re-configured key 
by entering the command: 

CONTROL and CURSOR RIGHT 

Key Wizard will display Ihe message: 

CONFIG ? 

Once again, type RETURN to abort. Otherwise enter ihe key you want 
to re-configure. Just like Strings, all values are permissible and 
similar restrictions apply. Hit RETURN lo undo the key (ie if it was 
previously re-configured) or else enler the new character which will 
take its place. When you assign a value, use the ORIGINAL Key, nol 
any other which may have been re-configured lo this value. For 
example, if you assign "A" to key "Q" and then wish to assign "Q" to 
key "J", use the "Q" key for the assignment, even though the "Q" key 
has already been given a value of "A" In this way you may rearrange 
as many keys as you wish. 

RE-CONFIGURED KEYS MAINTAIN THEIR ASSIGNED VALUES IN 
BOTH DIRECT AND RUN MODES. 



Background Routine 

You may wish to run a background task of your own on every 
keyboard (timer) interrupt. To do this, change the SECOND and 
THIRD BYTES of the DATA Statement in UNE 200, 1 have used 35, 
234, which is the address of an RTS instruction in the Kernel. By 
changing these to the address of your own routine, the JSR instruction 
(first byte, 32) will cause your own routine to be called. Remember the 
address is entered in the normal convention, low byte then high byte. 

Conclusion 

This ends Pari 2 on the Commodore 64 Keyboard. I realiy enjoyed 
developing the Key Wizard system and hope you enjoy the result. Go 
on lo Part 3 (next issue) if you have any interest in the design of a 
Keyboard Driver or if you wish to add to the routines already built into 
Key Wizard. You may find the exercise instructive and useful, 

KEYWIZ'64: the BASIC loader/fUe saver for Key Wizard 



IE 

HL 

DA 

BO 

OF 

KF 

Gl 

FF 

AG 

HA 

ME 
IN 

GD 

FN 
PH 
IK 
CB 
FP 

PB 
10 



1 rSm ***«t*i^V**:*WVI'*:*»:p|i#>ii».«Htt#i».ifc****« 

14 rem •■ an amazing keyboard driver •• 
16 rem *--' for your commodore 64 *♦•• 

ISrem--" aubrey Stanley dec1984 •♦- 

20 rem »■•*«*•»»••*••*•••*••**•••»•♦♦•• 

22 rem •* 

50lb$= "kernel" :pg$= 'kprg^Tom -tells loader how 

lo load kwiz* 
52 i = 5321 6:nk = 2:rem "irq address & n-key rollover 

count* 
54iftb$= "kernel" andpg$= "kprg" then 100:rem -use 

kernel tables & data lines* 
56 if ft>1 then lOOTem 'program and table files loaded 

from disk* 
58 if ft = 1 then 62;rem *program file loaded from disk* 
60fl = 1:ifpg$<>"kprg" then pg = 1:[oad "0:' +pg$,8,1: 

rem *load program file* 
62 ft = 2:iflb$<>'' kernel" then tb=128:load "0:" 

+ tb$,8,1:rem -load table file* 

64 goto 100 

65 rem •••t'**t*'**«vHH**V'HHw.»i>«#**«»## 

70 rem -save program, type - run 70* 

72 pg$= ''kwiz'':rem ■ prog ram file name- 

74ad = 41216:bd = 49152;n = 2400:rem *prog address, 

saved from address, byle count* 
76 open 2,8,2, " @: ^ + pg$ + " ,p,w " 
78 goto 88 



Thtt IkvnMietor 



28 



Vblumv 5, Ihu« 06 





JF 


79 rem »*•••***■••* 


PB 


332data 72, 77,141, 2,141,141, 2,141,142. 2 




\D 


80 rem »save tables, type- run 80* 


NP 


333data 41, 4,240, 34,173,141, 2, 41, 2,240 




ME 


82tb$- "kwjz.tb" rem *table file name* 


PO 


334data 11,169,128, 77,138, 2.141,138, 2, 76 




LO 


84 ad = 47072:bd = 49152:n = 2080:rem*table address, 


JL 


335data185,161,173,141, 2, 41, 1,240, 31, 77 




^^^ ^4^ 


saved from address, byte count* 


EK 


336data 37,161.141. 37,161, 76,185,161,173,141 




cc 


86open2A2,"@:"+tb$+'\p,w" 


ID 


337data 2, 41, 3,201, 3,208, 13,173,145, 2 




NK 


88 p r i nt#2 , ch r$(ad - int(ad/256) - 256) ; 


IF 


338 data 48, 8,173, 24,208. 73, 2,141, 24.208 




BO 


90 print#2,chr$(ad/256); 


LO 


339data 76,185,161,173. 34,161,240, 29,196,197 




AE 


92fori = 0ton-1 


KH 


340 data 208, 6,169, 64.133,203.133,197,152,160 




JO 


94 prin{#2,chr$(peek(bd + i)); 


BH 


341data 2,136, 48, 10,217, 28,161,208,248,169 




PD 


1 h F ^ ' ' 

96 next i 


RE 


342data 64,153, 28,161, 76,185,161, 32, 76,163 




AK 


98 cose 2 end 


JF 


343data169, 64,172, 27,161.173, 36,161,153, 28 




F ■ ■ X 

BK 


99 rem »**»***■***•■♦■*'•••*"******•*•**** 


EE 


344 data 161, 152, 73, 1.141, 27,161,169, 16,141 




EF 


100ch = 0:forn = 0to23:rem -irq vector code- 


PE 


345 data 140, 2,169, 4,141,139, 2, 32, 48,163 




NF 


1 

102 read a:pokei + n,a;ch = ch + a;next 


EM 


346data 76,185,161,173, 30,161,240, 91,173,141 




ML 


1 03 it chOI 996 then print " error in data " :end 


EN 


347 data 2, 41, 3,201, 3,240, 82, 44,138, 2 




DN 


104 itoQ = 1 then 112:rem * bypass program pokes if 


GF 


348data 48, 2,112, 75,173,140, 2,240, 5,206 






program loaded from disk* 


PF 


349data140, 2,208, 65,206,139, 2,208, 60,169 




FC 


106ch = 0:for i = 41216Io43615:rem -kwiz program 


LI 


350 data 4, 141, 139, 2, 169, 2, 141, 35, 161, 206 






code* 


GH 


351 data 35,161, 48, 45.174, 35,161,189, 28,161 




LE 


108 reada:pokej,a:ch = ch + a:next 


G 


352data201, 64,240,241,141, 36,161, 32, 76,163 




LL 


109 if ch<>301 952 then print "error in data" ;end 


JM 


353data 44,138, 2, 48, 18, 41.127,201, 20,240 




LP 


112 poke 41216, tb:rem *tels program whether tables are 


AK 


354data 12,201, 32,240, 8,201, 29,240, 4,201 






loaded from disk* 


OH 


355data 17,208,212, 32, 48,163, 76,253,162, 96 




AF 


116 poke 41218, nk: rem -tells program then-key factor* 


ED 


356 data 173, 36, 161 , 133, 203, 133, 197, 108, 143, 2 




HF 


118 poke 56334, peek(56334)and254, rem *disabe 


HF 


357 data 224, 224, 176, 13,138,166,198,236,137, 2 






1 1 ■ ' 

keyboard (timer) interrupt* 


HM 


358 data 176, 5,157,119, 2.230,198, 96,173, 36 




GH 


120 poke 788ii-int(i/256}*256);rem *set up irq vector 


■ IJ 


359data161, 10, 10,168,173,141, 2, 10,201, 8 






1 ^ ' 

address ow byte* 


GG 


360data144, 2,169, 6,170,189. 3,161,133,245 




CG 


1 22 poke 789,(i/256):rem *set up irq vector high byte* 


LK 


361data189, 4,161,133,246,177,245,170,172. 36 




KM 


124 poke 56334,peek(56334)or1:rem -enable keyboard 


JM 


362datal61, 96. 32,234,255,165,204,208, 41,198 






p 1 ■ ^ 

(timer) interrupt i 
126end:rem *of oading* 


LK 


363 data 205, 208, 37,169, 20,133,205,164,211, 70 




NE 


OL 


364data207,174, 135. 2,177,209,176, 17,230,207 




KG 


1 28 rem ***##*+*******p^#+tt*****+**#*+* 


FD 


365 data 133, 206, 32, 36,234,177,243,141,135, 2 




NP 


200 data32,35,234, 165,1, 41, 254, 


AE 


366 data 174, 134, 2,165,206, 73,128, 32, 28,234 






133.1,32,39.161,165,1,9,1,133 


NJ 


367 data 165, 1, 41, 16,240, 10,160, 0,132,192 




LD 


201 datal ,76,126,234,0,90,32 


EF 


368data165, 1, 9,32,208, 8,165,192,208, 6 




EO 


250 rem*****"**-*********"**"****"** 


AB 


369data165, 1. 41. 31,133. 1, 96,173. 0,161 




AB 


aOOdata 0, 0. 2, 0,184, 0,185, 0,186, 


Jl 


370data208. 44,162, 63,189,129,235,157, 0,160 




NG 


301 data 1 87, 254, 253, 251 , 247, 239, 223, 1 91 , 1 27, 255 


FA 


371data202, 16,247,162, 63,189,194,235,157, 64 




NE 


302 data 255, 255, 255, 255, 255, 255, 255, 0, 0, 


OK 


372 data 160, 202, 16,247,162, 63,189, 3,236,157 




BD 


303 data 0. 0, 0, 0, 0, 0, 0, 0, 0, 44 


AJ 


373 data 128, 160,202, 16,247,162, 63,189,120,236 




AF 


304data 1,161, 48, 62, 32,185,163,169,128,141 


OK 


374data157, 192, 160,202, 16,247,173, 0,161, 16 




OK 


305data 1,161,169, 46,160,165,141,143, 2,140 


J 


375 data 3, 76,116,164,162,228,142,199,160,232 




10 


306 data 144, 2, 169, 0, 133, 198, 141, 141, 2, 141 


JJ 


376 data 142, 194, 160, 232, 142. 255, 160, 232, 142, 252 




DN 


307datal42, 2,141, 27,161,141, 30,161,141, 37 


BK 


377datal60,232, 142, 192, 160,232, 142, 193, 160,232 




CG 


308 data 161, 141, 38,161,169, 64,133,203,133,197 


LG 


378datal42, 243, 160, 169, 0, 133,245,169, 184,133 




HE 


309data141, 28,161,141, 29,161,169,255,162, 7 


OA 


379 data 246, 32,117,164,189, 0,160,145,245,136 




KH 


310data157, 19,161,202, 16,250, 32,110,163,173 


LP 


380 data 136, 136, 136, 202, 16, 244, 169, 0, 133, 245 




ME 


311 data 38,161,208, 17,173, 30,161,208, 20,169 


GO 


381datal69. 185, 133, 246, 32,117,164,189, 64,160 




FN 


312 data 0, 141 , 0, 220, 173, 1 , 220, 201. 255, 208 


GH 


382datal45,245, 136, 136, 136, 136,202, 16,244,169 




GE 


313dala 8,162,254, 32, 55,163. 76,150,161,169 


JK 


383 data 0,133,245,169,186,133,246, 32,117,164 




BA 


314dala 8,141, 31,161, 32,156,161, 32,207,162 


HI 


384data189, 128, 160, 145,245, 136, 136, 136, 136,202 




00 


315data169,127,141, 0,220, 96,206, 31,161, 16 


EA 


385 data 16, 244, 169, 0, 133, 245, 169, 187, 133, 246 




HK 


316data 1, 96,174, 31,161,189, 11,161,141, 


NO 


386 data 32,117,164,189,192,160,145,245,136,136 




PN 


31 7 data 220, 173, 1,220,205, 1,220,208,248, 93 


II 


387datal36, 136.202, 16,244,162, 31,138,157,224 




DH 


318data 19,161,141, 32,161,172, 32,161,240,222 


DL 


388 data 183, 202, 16,249, 96,160,255,169, 0,145 




EG 


319data174, 31.161,136,152, 45, 32,161,168, 77 


LO 


389 data 245, 136, 16,251,162, 63,160,252, 96,252 




OP 


320dala 32,161,141, 33,161,140, 32,161, 93, 19 


EN 


390data167, 79,165, 78,165,235,167,105,165,119 




OP 


321data161, 45, 33,161,141, 34.161,240, 15,206 


DM 


391 data 166, 16,167, 43.168,120,168,158,168,139 




OG 


322data 30,161,173, 33,161, 93, 19,161, 29, 19 


MO 


■ 392 data 168, 78.165, 78,165, 78,165, 78,165, 78 




AE 


323data161, 76, 7,162,173, 30,161,205, 2,161 


KO 


393 data 165, 78,165, 78,165, 78,165, 78,165, 78 




HL 


324data176, 199, 173, 141, 2, 41, 3,201, 3,240 


LO 


394datal65. 78,165, 78,165, 78.165, 78,165. 78 




HF 


325 data 190, 238, 30,161,173, 33,161, 93, 19,161 


MO 


' 395 data 165, 78,165, 78,165, 78.165, 78,165, 78 




F ■ ■ 

DP 


326data 61, 19,161,157, 19,161,173, 31,161, 10 


CD 


396data165, 78.165, 0, 0,188,189,190,191, 83 




HP 


327 data 10, 10,168,173, 33,161,162,255,142, 36 


GL 


397 data 84, 82, 73, 78, 71, 32, 63.157, 67, 79 




ME 


328 data 161, 238, 36,161, 74,144,250,152, 77, 36 


FM 


398data 78. 71. 73, 71. 32, 63,157, 85, 83, 69 




KA 


329datal61,141, 36.161, 10, 10,168,173, 3,161 


JJ 


399 data 82, 32, 63,157. 32, 65. 76, 76, 32. 85 




LC 


330 data 133, 245, 173, 4, 161, 133, 246, 177, 245, 170 


KE 


400 data 83, 69, 68. 32, 85, 78, 68, 79, 78, 69 




BH 331dala172, 36,161,224, 5,176, 76,224, 3,240 


FB 


401 data 32, 79. 46, 75, 46, 78, 85, 76, 76, 32 


Th* Tranaoctor ^^ 


) Volum* 5, Imu* 06 





MC 


402 data 75, 69. 89, 32, 65, 66, 79, 82, 84, 83 


ID i 


543data 9, 41, 15,238, 41,165,172, 41,165,192 




OA 


403 data 65, 86, 69, 32, 80, 71, 83, 65, 86, 69 


LD 


544 data 4,240, 8,192, 2.240. 4, 10, 10, 10 




HM 


404 data 32, 84. 66,157, 95.254,226,157,255, 1 


BB 


545data 10,192, 3,176, 9, 13, 22,165,141, 22 




JM 


405 data 255, 228, 0,184, 8, 0.185, 30,224.191 


BE 


546data165, 76,223,167, 13. 21.165,141, 21,165 




KJ 


406data 46,165, 78,165, 0, 0, 0, 0, 0, 


JE 


547 data 192, 4,240, 3, 76, 58.163, 32, 58,163 




PK 


407 data 32. 52,165, 76, 58,163,138,224,224,176 


PA^ 


548data 76, 92,166, 76,248.165. 32,114,169, 32 




Fl 


408data 2,169,224, 41, 31, 10,168,185,131.164 


OEi 


549 data 188, 169, 174, 24,165. 36,157, 16. 3.108 




JN 


409data141,195, 164,185, 132, 164, 141,196, 164. 106 


II 


550data 25,165. 96, 36,157, 16, 18,169, 1, 45 




LC 


410 data 195, 164, 96, 32,114,169, 32,188,169,174 


KEj 


551 data 37,161,240, 11,224, 20,208, 8,162, 29 




FK 


411 data 24,165, 36,157, 16,242,169, 78,141, 38 


WiE\ 


552data 32, 58,163,162, 20, 96,224, 32,144, 19 




HB 


412 data 165, 169, 165, 141, 39,165, 76,239,168,169 


CN 


553data224, 128, 144, 4,224,160,144, 11.142, 20 




OHi 


413 data 131, 141. 143, 2, 169, 165, 141, 144, 2,169 


IE 


554 data 165, 162, 148, 32, 58,163,174, 20,165, 96 




PB 


414 data 201, 133,245, 169, 164, 133,246, 169, 9, 32 


HI 


555 data 36,157, 16, 72,169,183,160,224,162,192 




CJ 


415data226. 168, 76, 78,170,224,254,240,110,176 


KM 


556data 44, 42,165, 48, 6,169,161,160, 0,162 




MF 


416dala 8,224,227.176.107.224, 13,240,113, 32 


NF 


557data171,133.252, 132,251,169, 192, 133,254, 160 




ND 


417 data 114, 169, 32,133,169, 32,188,169,173, 26 


HN 


558 data 0, 132,253, 177,251, 145,253,200,208,249 




GL 


418data165, 201, 226,240. 87, 32,152,169,169, 


AE 


559data230, 252,230, 254,228,252,208,241, 44, 42 




HB 


419data141, 22,165,224,225,240, 47,160, 32,136 


PC 


;560datal65, 48, 10,169, 0,141, 1,192, 32, 50 




LJ 


420data 16, 16,169,226,133,245,169,164,133,246 


FG 


! 561 data 170,208, 3, 32, 64,170,169,128. 77, 42 




CP 


421 data 169, 9, 32,226,168, 76, 98,166,185,224 


CG 


562 data 165, 141, 42,165,162,141, 96, 36,157, 16 




EL 


422data183, 201,255, 240,230, 141, 21,165,142, 20 


10 


563 data 14,172, 43,165,136, 16, 2,160, 15,140 




ML 


423 data 165, 169,255, 153,224, 183, 169,225, 141, 19 


DO 


564 data 43,165,140, 33,208, 96, 36,157, 16, 14 




PN 


424 data 165, 32,226,169,174, 20,165,224.255,208 


1 


565 data 172, 45,165,136, 16, 2,160, 15,140, 45 




DK 


425 data 3, 32, 8,170, 32, 58,163,169, 18,141 


PC 


566 data 165, 140, 32,208, 96, 36.157, 16, 42,172 




NK 


426datal43, 2,169,166,141,144, 2,162. 61, 76 


GH 


567 data 44,165.136, 16, 2,160. 15.140, 44,165 




CO 


427 data 56,163,162, 63, 32, 58,163,162,157. 76 


EN 


568 data 140, 134, 2, 152, 160,216, 132,246, 160. 




HD 


428 data 58,163,169,255,133 


MA 


569 data 132, 245. 145, 245, 200, 208. 4, 230, 246. 208 




LH 


500data245, 169, 164, 133, 246, 169, 6, 32,226,168 


JE 


570 data247, 192, 232, 208, 243, 166, 246, 224, 219, 208 




EF 


501 data 76, 98,166,224,254,240, 41,224,227,176 


BF 


571 data 237, 162,255, 96,168, 10, 10, 10, 10, 10 




HO 


502data222, 224,225, 208, 9, 32,114,169, 32,188 


ML 


572datal33, 245, 152, 74, 74, 74,168,185,197,164 




FA 


503 data 169, 174, 24,165,224, 13,240, 26,173, 21 


JD 


. 573 data 133, 246. 96,141, 41.165.160, 0, 32, 10 




AD 


504 data 165, 32.207,168,172, 22,165,138,145,245 


B 


, 574 data 169, 208,251, 162, 255, 96,173, 26,165,141 




KC 


505 data 200, 238. 22,165,192, 32,240, 3, 76. 58 


EA 


I575data 41,165,173, 25,165, 32,207,168,160, 




HP 


606 data 163, 32. 58,163,173, 22,165,208, 18.173 


DM 


: 576 data 76, 27,169, 32, 10,169,208,248,162,255 




HE 


507 data 21,165.168,153,224,183,173. 20,165,141 


A 


■ 577 data 108, 38. 165, 177,245,201, 141.208, 2, 169 




MF 


508 data 19,165, 32, 22,170,208, 3, 32, 36,170 


HB 


578 data 13,170, 32, 58,163,200,206, 41,165, 96 




00 


509data 32.226.169,173, 40,165,141.138. 2.169 


BC 


1 579data165, 198,205, 137, 2,144,222.165,245,141 




KM 


510data 46, 141, 143, 2, 169, 165, 141, 144, 2, 162 


EN 


580data 34,165.165,246,141, 35,165,140, 33,165 




OA 


511datal41, 76, 58,163,169,145,141,143, 2,169 


PN 


■ 581 data 173, 143, 2, 141, 36, 165, 173, 144, 2, 141 




60 


512 data 166, 141, 144, 2, 169,210, 133,245, 169, 164 


MJ 


582 data 37,165,169, 77,141,143, 2,169,169,141 




BB 


513 data 133, 246, 169, 9, 32,226,168. 76, 78,170 


LB 


583data144, 2,162,255,142, 38,161, 76, 58,163 




PP 


514 data 224, 254, 240, 68, 176, 7,224,225,144, 3 


OH 


584 data 165, 198,208,244, 173, 34, 165, 133,245, 173 




PM 


515 data 76,248,165,224, 13,208, 3, 76, 2,166 


10 


585data 35,165,133,246,172, 33,165,173, 36,165 




JB 


516data 32,114,169, 32,133,169, 32,188,169, 32 


DA 


586 data 141, 143, 2, 173, 37, 165, 141, 144, 2, 169 




OJ 


517data152, 169. 173, 22,165,201,226.240, 8.142 


,NH 


587 data 0,141, 38,161, 76, 0,169,173, 36,161 




Nl 


518data 20,165,169,226,141, 22.165,174, 20,165 


DP 


588data 10, 10,141, 30,165,165,245,141, 31,165 




MG 


519 data 224, 255, 208, 3, 32, 8,170, 32. 58,163 


BM 


589data165, 246, 141, 32,165, 96,173, 30,165,141 




KO 


520 data 169, 220, 141, 143, 2, 169, 166. 141, 144, 2 


HF 


590data 27,165,173, 31,165,141, 28,165,173, 32 




GG 


521datal62, 61, 76, 58,163,224,254,240,249,224 


00 


591 data 165, 141, 29,165, 96,173, 23,165.141, 19 




KM 


522 data 227, 144, 3, 76,248,165, 32,114.169, 32 i 


IM 


592 data 165, 173, 24,165,141, 20,165,173, 25,165 




EH 


523 data 188, 169,224,225,240, 7, 173, 26, 165,201 


GG 


593data141, 21,165,173, 26,165,141, 22.165, 96 




BO 


524 data 226, 208, 3,174, 24,165,224, 13,208, 8 


BL 


594 data 173, 28,165,133,245,173, 29,165,133,246 




GO 


525 data 169, 0.141, 22,165, 76, 81,166,142, 19 


NK 


595data 96,173, 31,165,133,245,173, 32,165,133 




NB 


526 data 165, 32, 58,163, 76, 92.166,169, 42,141 


HM 


596data246, 173, 30,165,168,177,245,141, 23,165 




HP 


527 data 143, 2, 169, 167,141, 144, 2, 169,219, 133 


NF 


597 data 200. 177,245.141, 24, 165,200,177,245,141 




KJ 


528data245, 169, 164, 133,246, 169, 7, 32,226, 168 


PP 


59edala 25,165,200,177,245,141, 26,165, 96,173 




KP 


529data 76, 78,170.224.254,240, 82,176, 18,224 


EK 


599data 28,165,133,245,173, 29,165,133,246,173 




CA 


530data224, 144, 7,224,227.240, 10, 76,248,165 


DJ 


600 data 27,165,168,173. 19,165,145,245.200,173 




PH 


531data224, 13.208, 3, 76, 2,166, 32,114,169 , 


GH 


601 data 20,165,145,245,200,173, 21,165,145,245 




JJ 


532data 32,133,169, 32,188,169, 32,152,169,224 


PJ 


602data200,173, 22,165,145,245, 96,169,247,133 




CO 


533 data 227, 240, 8,142, 20,165,169,227,141, 19 


10 


603data245, 169, 164, 133,246, 169, 8, 32,226, 168 




HP 


534 data 165, 169, 0,141, 21,165,141, 22,165,174 


lA 


604 data 96, 169,235, 133,245, 169, 164, 133,246, 169 




KK 


535 data 20,165.224,255,208, 3, 32, 8,170, 32 


Kl 


605 data 7, 32,226,168, 96,169,242,133,245,169 




EG 


536data 58,163,169, 0,141, 41,165,169,131.141 


Nl 


606 data 164, 133,246, 169, 5, 32,226,168, 96,169 




PB 


537dala143, 2,169,167,141,144, 2,162, 61, 76 


FB 


607 data 5,133,245, 169, 165, 133,246, 169, 7, 32 




EB 


538 data 58, 163,224,254,240,249,224,228,144, 3 


FJ 


608data226. 168, 96,169, 12,133,245,169.165,133 




HJ 


539data 76,248,165,224,225,144, 9, 32,114,169 


AJ 


609 data 246, 169, 7, 32.226,168, 96,173,138, 2 




NC 


540 data 32,188,169,174. 24,165,224, 13,208, 3 


CB 


610data141. 40,165,169, 64,141,138, 2, 96, 1 




EP 


541 data 76, 81,166,138,201, 48,144, 65,201, 64 


GL 


611 data 255, 1,255. 1,255 




PE 


542data240, 61,144, 7,201, 71,176. 55, 24.105 







TIm IVansoctor 



30 



Volumes, l>su« 06 



Linked Lists 
Part 2 



K. Murray Smith 
London, Ont. 



In Part 1 we examined how linked lists could be used to "sorl^' the 
records in a file into a particular order. Ir was shown thai ihc 
technique of linking avoided Ihe shuffling ol elemenls within the 
sloraqe array, allowed all the items lo be kept in the same array and 
permitted different yroups of these items to be sorted on different 
fields. 

The Rentawreck rental agency now has all of its vehicles linked into 
three lists: one for those rented (linked by due date), another for those 
available (linked by mileage), and a final list for the vehicles currently 
bemg serviced (also linked by mileage). 

We now must write a program which wili let the company update its 
lists as vehicles are returned, rented, serviced, sold or purchased, and 
alsodisplavorprintany nneof thelistsin to/rt'c/ort/er This program 
will be one to be used interactively over and over again, whereas the 
previous startup program was only used once !o produce the initial 
linkages For ease of use this program will be menu-driven. Figure 1 
shows the menu choices- 
Loading the Lists 

The linked lists generated in Part 1 were stored in a sequential file 
along with the size of the arrays being used and the entry points to 
each of the linked lists. Program I reads these data. Table 1 defines 

ttie variables used. 

After reading in the array si^e(S) which had been used for saving the 
file (line 30), the user is then asked if he/she wishes to increase the 
array sizes (lines 70-110). This might be required when several new 
vehicles arc purchased. As an assist, the number of elements cur- 
rently used is shown (40-50). Following this decision, the stored data 
is read in (240-270). If the arrays were increased in size the extra 
elemenls in the licence plate, due date and mileage arrays arc now set 
to blanks (320-:M0) as in the Part I program and the pointer list 
altered to accommodate the new free elements (360-410). 

Lines 230 and 2fiO are needed due to the dynamic nature of BASIC 
strings. This provides for very flexible programming as it is not 
necessary to tell the computer how many bytes to allocate for each 
string variable; rather the allocation is based on the number of bytes 
actuallv used. An unfortunate side effect of this is that when a string 
such as " ABC" is saved in a sequential file and then recalled, the 
leading blanks are lost. Since the decision was made in Part 1 to use 
strnigs to store mileages, the values read from the file must be 
'massaged'^ to put in leading blanks where necessary. Otherwise the 
mileage string '1 569" will be ^^rea/tT than the mileage string "14583"! 

Lines 230 and 260 make sure "1 569" is used as " 1569". 

Displaying or Printing a List 

To displav or print one of the lists in order we simply enter the array 
using the pointer to the start of the list and then, using the linkage 
array, follow the list through until a zero is found as a pointer to the 



next element. Menu selection or I will prompt with a second menu 
requesting which of the three lists is required. 

Updating a List 

Whenever a vehicle's status is altered, there are two lists affected. For 
example, when a vehicle is sold, pointers in the available portion of 
the link array must be altered to exclude this vehicle and pointers for 
the free space must be altered to /nclude the elements formerly used 
by this vehicle. When a rented vehicle is returned, pointers must be 
changed In both the rented and available sections of the link array. 

Menu selections 2-7 control list updates to log a returned vehicle, to 
rent one, to send one for ser\'icmg, to remove a vehicle to be sold and 
to make available a vehicle that has just been purchased. 

The Mechanics of Updating 

Adding or removing an element to or from a list are the basic list 
updating operations. The classical way of deletins^ an element is to 
locale it in the array and move every element past it one location 
closer to the front. Figure 2a shows an alphabetic array from which D 
is to be deleted and Figure 2b shows the array after the deletion. 
Insertion of the letter H into the array of Figure 2b requires locating 
where the H belongs, moving every element past this spot one 
location farther back in the array and then iiiserting the H. 

This method for insertion and deletion is not efficient if the operation 
occurs anywhere but close to the end of the array, if a multidimen- 
sional array is involved or if the elements of more than one array must 
be moved. 

Linked lists show their superiority in the areas of adding and remov- 
ing items as well. To delete an element, simply alter the pointers to 
and from this eleinent and then return this element to the free list 
(making it the first one available for future use which will tend to keep 
early elements of arrays occupied). To insert a new quantity, it is first 
stored in the next free element, the pointer to the first free one is 
adjusted, its proper location is found and then the pointers to and from 
it are set. This seems like a great deal of work but the implementation 
is simple and it avoids shifting many array elements. 

Changing an element from one linked list to another does not require 
a physical move of the data: one set of pointers is altered to exclude a 
specific element in one or more arrays and another set of pointers is 
altered to include this element. 

To insert or delete an element at the beginnmg of a list requires that 
the vanable storing the entry point lo that linked list be updated 
appropriately. For elements at the end of a list, it must also be 
remembered to set the appropriate pointer to zero to indicate the end 

of a list. 



Th« Troniactor 



31 



Volume 5, Issue 06 



The Updating Program 

Program 2 conlains the addilions to Program I to perform the menu 
functions. In addition to outpuUing and updating lists, the menu 
provides an additional choice: a check for overdue vehicles in which 
ail vehicles with a due dale prior to the current date are displayed on 
the screen (with a printed-list option). In this way ail the information 
on a possibly stolen vehicle is available quickly. 

Table 2 conlains a brief description of the new variables introduced in 
Program 2. 



call to a general subroutine at line 13000 and the correct list entry 
point is needed and this is also updated if necessary after the return 
(2250-2280). 

The line-3000 block looks after the renting of a vehicle. It is very 
similar to the above block and so does not need to be described in 
detail. Line 3130 checks to see if there are more or fewer than 5 
characters in the requested due date or if the month number is more 
than 12orifthedayismorethan3LAgainnot foolproof, but will trap 
quite a few common errors. Note also the different subroutine re- 
quired to put the vehicle in the rented list (3250). 



FL is used as a flag to indicate whether or not any lists have been The blocks at lines ^000 and 5000 move the vehicles between the 
altered during the running of the program. The flag is lowered (set to availablelist and the list of vehicles being serviced and are similar to 
0) in line 145 and will be raised (set to l)if there are any changes. the previous two blocks- 



Starting at line 500 the menu is presented (500-620), the selection is 
obtained (630) and checked for validity (640-660), Although ail the 
choices are single digit, INPUT is used rather than GET because of the 
brief moment in which the user might detect an erroneous input and 
then be able to change it. As the program stands, this is important as it 
has not been "idiot-proofed" as would be necessary in a commercial 
package. Someoftheoptionswill not letyou exit them until they have 
been successfully completed. Of course you could use the comple- 
mentary routine to undo the error if this ever happens to you. Keep in 
mind as well that the purpose of the program is to illustrate the use of 
linked lists, not bullet-proofing! 

Control is then transferred to the appropriate subroutine (670-700). 
Every return from a subroutine will send the user back to the main 
menu (690,710). 

The block beginning with line 1000 handles options and 1 for 
showing a particular list, A menu is presented (1010-1070) and the 
selection (1080) is checked for validity (1090-1 HO). If the option is not 
"3" to return to the main menu (1120), then the entry point to the 
appropriate list is established (1130-1150). If the entry point to a list 
happens to be a zero (1 1 60), then there are no vehicles in the list. After 
opening a channel to the printer if necessary {1 180), the information 
about the first vehicle in the list is displayed or printed as required 
(1190-1200) and a check is made to see if this is the last vehicle in the 
list (1210). If not, the variable EN is changed to point to the next item 
in the list (1220), this is printed or displayed and so on. An end of 
listing message is printed (1240), The printer channel is shut down if 
necessary (1250) and the program pauses (1260-1290) before return- 
ing to the display-print sub-menu. 

The line-2000 block handles the return of a rented vehicle. After 
checking to see if in fact there are any vehicles rented (2020) and 
returning to the main menu if there are not (2030-2070), the returned 
vehicle's licence plate number and the new odometer reading are 
requested (2080-2150). The odometer reading is then massaged 
(2160-2170) as discussed previously and the vehicle is located in the 
rental list and removed (2190-2200). Since the subroutine at 1 1000 is 
called from several options in the main menu, the entry point for the 
rental list must be specified (2190). A value of 1 for F2 indicates that 
some problem occurred in the search subroutine and an immediate 
return to the main menu is performed (22 1 0). Note that the value of FL 
is not changed until line 2290, that is until the vehicle has been 
successfully put into the available list (2250-2270), Having found the 
returned vehicle in the rented list, its mileage and due date entries are 
adjusted (2220-2230) and the pointer to the beginning of the rental list 
is updated (2240) if the first vehicle on the rented list was the one 
removed- Putting the returned vehicle in the available list also uses a 



The line-6000 block controls the selling of a vehicle. In this operation 
the vehicle is only removed from a list and not added to another so 
there is no second GOSUB. Also the total number of vehicles owned 
by the company {or the number of array elements actually in use) is 
reduced by one (6180), 

The next block makes a new vehicle available by finding the first 
available element (7200), storing this vehicle's data in this element of 
the plate number and mileage arrays (7220-7230) and then resetting 
the pointer to the start of the free space (7210). This vehicle is then 
linked into the available list (7240-7260) and the total number of 
vehicles is increased by one (7270). 

The line-8000 block checks for overdue vehicles. The main part is the 
section which traces the path through the list of rented vehicles 
(8160-8220). 

The final block of coding coming from the main menu begins at line 
9000, If the flag FL is still down, then no changes have been made to 
any lists and so the program stops at this point (9010), (f the flag is 
raised {value \). then the old file called LINKED LISTS is scratched 
(9020-9040) and an updated one of the same name is created (9050- 
9120). Line 9050 defines a carriage return variable for use in the 
PRINT* operation. 

Blocks beginning with lines 11000 and 12000 locate a vehicle by plate 
number and remove it from that list. Since they differ only in the last 
couple of lines, it is possible to combine them if a check is made to see 
which finishing part is required and if the calling routines use a 
pointer which can be passed to the subroutine to indicate which part 
is needed- hfowever, the increased program complexity needed to 
save less than a dozen lines is not warranted. 

At the beginning of the line-1 1000 block a flag is set low(l 1010) and it 
will be raised (set to I) if the vehicle is not found in the list. The entry 
point to the appropriate list is copied to K(H 020), A check is made to 
see if the plate number being looked for is at the beginning of the list 
(1 1030). If not, this subscript is stored for future use (1 1040) and the 
element to be examined is set to the next one in the list (1 1 050), If this 
element is not zero (11060), then it is checked for a match. If the 
element number is zero, we are at the end of the list with no match 
made. A message is printed, the flag F2 is raised and we return to the 
calling routine (11070-11120). If a match was found in line 11030, 
then a check is made to see if the match occurred for the first element 
in the list (11 130). Ifso, this vehicle is removed from the list by setting 
the entry point to this list to the next element of the list (1 1 140), If not, 
the element in the link array which pointed to ihis element is set to 
skip this element and point to the next one (1 1 160). In either of the 



Ihm l^ontochir 



33 



V6lum« 5, litu* 06 



above cases, the location of the match is kept for future use (H 1 70), 

As menlioned before, the line- 1 2000 block is almost the same as the 
one described above. However, when a vehicle is sold we do not have 
to remember where it is in the array. In fact, we want to make that 
location available for use if a vehicle is purchased and so we set the 
pointer of the removed vehicle to point to the first element of the free 
list (12160) and then make the location of the removed vehicle the 
newstarlof the free list (12180). 

The blocks at lines 13000 and 14000 locate by mileage and due date 
respectively the correct location for an item in a list and then insert the 
item in that spot. As discussed previously, these routines also could be 
combined into one. As in the above two blocks, the list is searched to 
find the correct location for the vehicle whose data are in the elements 
numbered N of the arrays (13010-13050 or 14010-14050). This N is 
the quantity that had been saved above for future use. If the vehicle 
belongs at the end of the list, Ihe pointer of the last element in the list 
is set to point to element N (13060 or 14060) and the pointer for 
element N is set to zero to indicate the end of the list (1 3070 or 1 4070)- 
If it belongs at the beginning of the list, then the list entry value Is set 
to N (13100 or 14100) and the pointer for element N is set to what used 

to be the first element of the list (13130 or 14130). If the vehicle 
belongs somewhere between the endpoints of the list, the pointer of 
thepreviousvehicleischanged to point to this one (13120 or 14120) 
and this one's pointer is set to the next vehicle's element number 
(13130 or 14130). 

Summary 

Now that Ihe updating program for Rentawreck is debugged and 
working, Ihe sample DATA statements used in the Part I program can 
be replaced by the actual vehicle data and the array sizes increased lo 

a sufficiently large value. More arrays for additional fields of informa- 
tion can also be added now. 

If you have had an opportunity to run the final programs from Part 1 
and Part 2, you may be disappointed at how long it takes to establish 
the initial linked lists and surprised at how rapidly you return lo the 
main menu after making a change in a list. Remember though that the 
initial setup is done only once. (A machine language subroutine for 
the actual linking section might appeal to someone out there as well) 

There are several features of linked lists which have not been 
addressed in the car rental example. Consider the request for all of the 
data about a vehicle whose licence number you are given. It is 
awkward to have lo go through ail three lists looking for this vehicle. If 
all the vehicles were linked alphabetically by licence plate, the search 
would be faster. The programming cost to implement this? One more 
array. 

Also note that all of the searches begin at the start of the linked list. In 
the case of a search of all vehicles for a particular plate number, why 
not just look at the first entry in the plate array? If this is before the 
plate we want then go on further following the linkage, but if it is past 
the one we want then why not back up through the list? To do this 
would require what is known as backward linking of the plate 
numbers, a fairly easy task once forward linking is understood. 

Possibly by now you have thought of some other applications for 
linked lists - that coin or stamp collection you have always meant to 
organize, your recipes, that mailing list which seems to take forever to 
update and re-sort. You may even have seen that some of the sections 
of the Part 2 program can be easily written in machine code. Once you 



have the ability to add items to or remove them from a linked list and 
you realize that single characters entered from the keyboard could be 
the items in a linked list, then you might be able to write that special 
routine you seem to need all the time but can't find in a wordprocessor 
within the reach of your budget. . . 

Figure 1 
LINKED LIST MEINU 

Display a list 

Print a list 1 

Return a vehicle 2 

Rent a vehicle 3 

Remove a vehicle for service 4 

Make serviced vehicle available 5 

Sell a vehicle 6 

Add a new vehicle 7 

Check for overdue vehicles 8 

Quit program 9 



Figure 2 

2a A B D G I KM before deletion of D 
2b A B G I K M _ alter deletion of D 
2c A B G H 1 KM after insertion of H 



Table 1 
Description of Variables 

a string of 6 blanks to provide leading blanks where 

necessary in the mileage strings 
D$ single letter answer to any yes/ no question 

LD the array of pointers for the linked lists 

NS new array size if needed 

PL$,DU$,M1$ arrays for licence plate nums, due dates, mileages 
S Ihe size of the arrays stored in the file 

SZ the size to which arrays will be dimensioned 

SR,SA,SS the element numbers for the start of the lists of vehicles 

currently rented, available or being serviced 
SF the first free element in the arrays 

UL the number of elements actually used in arrays in the 

file 

Table 2 
Description of Variables 

CI main menu choice 

C2 display-print menu choice 

CR$ holds a keyboard entry (expecting a carriage return} 

DAS today's date 

EN current element number while going through a linked list 

FL a flag to indicate whether changes have been made to any list 

F2 a flag to indicate that an abnormal condition caused an exit from 

a GOSUB 
K the current element being examined in a list (similar to EN) 
LS subscript of the last element examined in a list 
N location of an element to be added to a list 
ND$ an input due dale 
NM$ an input odometer reading 
NP$ an input licence plate number 
S$ a blank space used for output 
SE entry point to a linked list 



r Th» frqnaocter 



33 



Voluma 5, !»!»• 06 



Program 1 


CP 


620 printtab{12);"(|your choice {0-9)":" |1|||^ 


r 1 


NA 


630 in put c1 




KG 
AJ 
MB 


10 rem- program 1 

20 openi ,8,2, " 0. linked lists.r " 

30 input#1 ,s,ul,snsa,ss,sf 


PD 
OA 
AE 


640 if c1 > = and c1< = 9 then 670 




650 print " «invaiid choice: must be 0-9»| 


OQQ ^^^H 


660 goto 620 






El 


40 print chr$(147) " the array sizes are" ;s 


FL 


670ifc1>1 then 700 




ME 


50 print ul; - elements are current y used, " 


FK 


680 gosub 1000 




MD 


60 for 1 = 1 to1000:nexti 


DF 


690 goto 500 




EG 


70 print "do you wish to increase the array sizes" 


HH 


700 on c1-1 gosub 2000,3000,4000,5000. 




HB 


80 print 'at this time?" 




6000,7000,8000,9000 




AL 


90 print ■ (type y or n):"; 


HG 


710 goto 500 




CA 
JP 


100 get d$ 
nOifd$= " then 100 


MH 
HE 


1 000 rem- display {c1 = ( 


Dior. 


jrint(c1 = 1}afist 


1010ifc1=0then print" 




'';tab(14); "dispay menu" 




GA 
KL 


120 print d$ 

130ffd$= "n" then210 


EG 
PM 


1020ifc1 = 1 then prim" 


'6<J\L 


";tab(14);" print menu" 


1030printtab(8);" 


Hrented vehic es ' 




IL 


140ifd$<>>Mhen90 


GE 


1040printtab(8);" 


Havailab e vehicles 1 " 




LI 


1 50 input" new array size " ins 


AD 


1050printtab(8);" 


Hvehfcles being serviced. . .2" 




FJ 


160ifns>sthen 190 


PH 


1060printtab(8);" 


Hreturn to mam menu 3" 




NH 


1 70 print ' new size must be greater than " iS 


CK 


1070 printtab(12);^^our choice (0-3)";" ||Q|\ 




NF 


180 goto 150 


DN 


1080 input c2 




OC 

IG 

BK 


190sz = ns 
200 goto 220 
210sz = s 


MD 
IL 
CF 


1 090 if c2> = and c2< = 3 then 1 1 20 




1 1 00 print " «jnvalid choice: must be 0-3>:: 


QQO ^^^1 


1110goto1070 






JK 


220 dim pl$(sz),du$(sz),mi$(sz), d(sz} 


ME 


1120 if c2 = 3 then return 




EA 


230 b$ = " [6 spaces] " 


PB 


1130 if c2 = then en - sr 




HA 


240fori = 1 tos 


HO 


1140ifc2 = 1 thenen = sa 




HA 


250:input#1,pl$(i),du$(i),ml$(;),ld(i) 


LD 


1150i1c2 = 2thenen = ss 




KJ 


260 mi$(i) - leftS(b$,6-len(mi$(i))) + mi$(i) 


KJ 


1160 if en = Othen 1240 




NO 


270 next i 


CN 


1170s$=" " 




LO 


280 c osel 


JO; 


1180 if c1 =1 then openi, 4 




JN 


290 if ns = then 440 


LF 


1 190 if c1 = then print pl$(en);s$;du$(en);s$;mi$(en) 




ED 


300 rem- initialize new array sections 


JKB 


1200 if c1 =1 then print#1, p$(en);s$;du$(en);s$;mi$(en) 




JJ 


310 fori = s+1 to ns 


MM 


1210ifen = 0then 1240 




DC 


320 :pl$(i}= "[7 spaces] ^ 


AA 


1220en = ld{en) 




NC 


330 :du$(i)= 15 spaces] ^ 


AN 


1230 goto 1190 




CC 


340 :mi$(i)=" [6 spaces]" 


EE 


'■ 1240 printtabd 1); "BBI« end of isting»' 




ND 


350 next i 


PD 


1250 ifcl =1 thenclosel 




GP 


360 rem- link rest of free space 


GK 


1260 print''Hpress<return> to return to menu" 




GG 


370 i = s 


NG 


1 270 get cr$ 




BG 


380ld(i) = i + 1 


CF 


1280 If cr$<>chrS(13)then 1270 




NM 


390:i = i + 1 


PP 


1290 goto 1000 




KJ 


400 if i<ns then 380 


PO 


2000 rem- return a vehic e 




FA 


410ld(ns) = 


CM 


201 printtab(5), " j^fflreturn a vehicle.., ' 




CL 


420 rem- make array size change permanent 


JD 


2020 if srX) then 2080 




DC 


430 if sz>s then s = sz 


IN 


2030 print "Hno vehicles currently rented..." 




EO 


440 print" « ist loading completed »" 


DK 


2040 print "Jpress <return> to return to main menu " 




PB 


19999 end 


JH 


2050 get cr$ 




CF 


2060 if crSOchrS 13) then 2050 


Program 2 


CD 


2070 return 


1 1 


KC 


2080 input" plate number \np$ 




NG 


10 rem- program 2 


JC 


2090 if en(np$) = 7 then 2 1 20 




JP 


145fl = 


GA 


2100 print ''**p ate must be 7 characters...** ' 




OJ 


500 rem- main menu 


OD 


21 10 goto 2080 




AL 


510 print "BflMrentawreck car rental agency" 


GC 


2120 input "odometer reading ";nm$ 




BH 


520 printtab(3)- H^^splay a list " 


EJ 


2130 If en(nm$)< = 6then2160 




01 


530 printtab(3) 


;"Bprintalist . .1 " 


JP 


2140 print "H*'*''^^^''^9''^° arge...999999max *•' 




HL 


540 printtab(3) 


; "Hreturn a vehicle 2 " 


EG 


2150 goto 2120 




BE 


550 printtab{3): 


;"Hrent a vehicle 3" 


01 


2160b$= " espaces " 




GJ 


560 printtab(3) 


; "Hremove a vehicle for service . , , ,4" 


HD 


21 70 nm$ = left$(b$,6-len(nm$)) + nm$ 




CO 


570 printtab(3) 


; "Hmake serviced vehiceavatable. .5" 


BE 


2180 rem- locale vehicle in renla island remove 




GE 


580 printtab(3) 


; "Hsell a vehicle 6" 


CM 


2190se = sr 




LD 


590 printtab{3) 


, "Haddanew vehice 7" 


JC 


2200 gosub 11000 




CD 


600 printtab{3) 


; "Hcheck for overdue vehicles S" 


DJ 


2210iff2 = 1 then return 




BK 


610 pnnttab(3) 


;"Jquft program 9" 


MA 


2220mi$(n) = nm$ 



TIm IVon factor 



34 



Volume 5, E»uo 06 



KD 
BA 
BC 
GO 
HH 
GP 
LF 
IB 
MA 
GJ 
80 
DM 
LI 
EG 
MD 
KB 
CB 
FB 
00 
JC 
DE 
00 



KG 

PE 

FB 

EH 

NP 

HG 

AC 

MP 

CK 

KL 

MN 

PE 

NP 

PC 

MO 

AD 

PC 

NM 

LK 

DH 

JE 

GC 

CA 

KP 

BA 

GN 

EB 

AG 

ED 

NL 

HC 

OE 

BA 

Kl 

HG 

BA 

GL 

FO 

CK 

OA 

AE 



Ipress <relurn> to return to main menu " 



+ * 



2230du$(n}= "[5 spaces]' 

2240 sr = se 

2250 rem- put vehicle in available list 

2260 se = sa 

2270 gosub 13000 

2260 sa = se 

2290 il = 1 

2300 return 

3000 rem- rent a vehicl e 

301 printlab(5); " ^Brent a vehicle.., " 

3020 if sa>0 then 3080 

3030 print 'Hno vehicles currently available.., 

3040 print 'Bp 

3050 gel cr$ 

3060 if cr$<>chrS{13) then 3050 

3070 return 

3080 input " plate number" ;np$ 

3090 It len(np$) = 7 then 31 20 

3100 print" "-plate must be 7 characters.,. 

3110golo3080 

31 20 input '■ due date (as mm-dd} ' ;nd$ 

31 30 if len(ndS)< - 5 and left$(nd$,2)< -"12" 

andright$(nd$,2)<="3r then 3160 
3140 print "H"invalJd due date** " 
3150goto3120 
3160 rem- locatevehideinrentallisi and remove 

3170se = sa 

3180 gosub 11000 

3190 if 12 = 1 then return 

3200 du$(n) = nd$ 

3210mi$(n)= ^[6spacesj^ 

3220 sa = se 

3230 rem- put vehicle in rented list 

3240 se = sr 

3250 gosub 14000 

3260 sr - se 

3270 fl = 1 

3280 return 

4000 rem- remov e a ve hicle for service 

4010 printtab{5); "UJsend a vehicle for servicing... ' 

4020 if sa>0 then 4080 

4030 prinfMno vehicles currently available... " 

4040 print "B^ress <return> to return to mam menu 

4050 get cr$ 

4060 if cr$<>chr$(13) then 4050 

4070 return 

4080 Input 'plate number ';np$ 

4090 if len(np$) = 7 then 4 1 20 

4100 print" ••plate must be 7 characters,. .••' 

4110QOto4080 

4120 rem- locate vehicle in available list and remove 

4130se = sa 

4140 gosub nooo 

4150iff2 = 1 then return 

4160sa = se 

4170 rem- put vehicle in service list 

4180se = ss 

4190 nm$ = mi$(n) 

4200 gosub 13000 

4210ss = se 

4220 fl = 1 

4230 return 

5000 rem- make a serv iced vehicle available 

501 prinltab(5), " EBBI return a serviced vehicle.,, " 



BA 
CH 
LF 
BD 
AB 
KO 
CO 
NO 
OL 
PP 
IM 
AE 
FK 
PA 
MG 
JO 
OE 
PE 
JO 
IG 
NM 
Kl 
FF 
PD 
HK 
FW\ 
JN 
NE 
DC 
lA 
MN 
EN 
FO 
AL 
FP 
AC 
OA 
U 
BA 
IC 
MC 
HJ 
EF 
JO 
BM 
HK 
JC 
00 
FD 
LA 
CP 
EM 
ML 
BN 
IJ 

AO 
IL 
OC 
LI 
GA 
AC 
JM 
JB 
EG 



5020 if SS>0 then 5080 

5030 print "Hno vehicles being serviced.,." 

5040 print "flpress <return> to return to main menu " 

5050 get cr$ 

5060 if cr$<>chr${13) then 5050 

5070 return 

5080 input" plate number " ;npS 

5090 if len(np$) = 7 then 51 20 

51 00 print """plate must be 7 characters,,,"'" 

51 10 goto 5080 

5120 rem- locate vehicle in available list and remove 

5130se = ss 

5140 gosub 11000 

5150iff2 = 1 then return 

5160ss = se 

5170 rem- put vehicle in service list 

5180se = sa 

5190nm$ = mi$(n) 

5200 gosub 13000 

5210sa = se 

5220 fl = 1 

5230 return 

6000 rem- to sell avehlcle 

601 printtab(5); ' BBIsell a vehicle,,/ 

6020 if sa>0 then 6090 

6030 print " ^available list empty.,, " 

6040 print" vehicle must be here to be sold' 

6050 print "Hpress <return> to return to main menu ' 

6060 get cr$ 

6070 If crS<>chr$(1 3) then 6060 

6080 return 

6090 input " plate number " ;np$ 

61 00 if len(np$) = 7 then 6130 

6110 print" •"plate must be 7 characters...**" 

61 20 goto 6090 

6130 rem- search for vehicle and remove 

6140se = sa 

6150 gosub 12000 

6160iff2 = 1 then return 

6170sa = se 

6180ul = ul-1 

6190 fl = 1 

6200 return 

7000 rem- add a new v ehicle 

701 printtab(5); ' ^Qadd a new vehicle... "■ 

7020 if sf>0 then 7090 

7030 print " ^arr ay full - no free space " 

7040 print " addition cannot be made ' 

7050 print " ({press <relurn> to return to main menu ' 

7060 get cr$ 

7070 if cr$<X)hr$(1 3) then 7060 

7080 return 

7090 input "plate number";np$ 

7100iflen(np$) = 7then7130 

7110 print" "*plate must be 7 characters.,.-* " 

7120 goto 7090 

7130 input "odometer reading ";nm$ 

7140 if ten(nm$)< = 6 then 71 70 

7150 print "H*'reading loo large,. ,999999 max**" 

7160 goto 7130 

71 70 bS^" [6 spaces]" 

71 80 nm$ = left$(b$,6-len(nm$)) + nm$ 

71 90 rem- add vehicle to available list 

7200 n - sf 



T1i# IVonwctor 



35 



Volume 5, liiuv 06 



KJ 

JK 

OJ 

KF 

LO 

KG 

LG 

JN 

GJ 

HG 

ON 

01 

KH 

LI 

IM 

KB 

KO 

OB 

CB 

CG 

JE 

01 

00 

CL 

GO 

DB 

BE 

IN 

CA 

PN 

PJ 
MH 
IE 
FK 
FO 
LL 
KK 
EH 
BP 
RE 
EL 
OD 
DC 
DL 
LK 
OE 
PI 
AE 
LG 
JG 
NE 
Jl 
OJ 
CA 
MB 
JE 
KO 
EM 
PB 
LK 
BL 
DP 



7210sf = ld(sf) 

7220 pl$(n) = np$ 

7230 mi$(n) = nm$ 

7240se = sa 

7250 gosub 13000 

7260 sa = se 

7270 ul = ul + 1 

7280 fl = 1 

7290 return 

8000 rem- check for overdue vehicles 

8010 if srOO then 8040 

8020 print " H"iere are no vehicles currently rented " 

8030 return 

8040 print "^Jwould you like a printed list also? " 

8050 print" (type yorn):"; 

8060 get d$ 

8070ifd$="" then 8060 

8080 printdS 

8090ifd$= 'n' then8110 

SlOOifdSO'y" then 8050 

8110 print "enter today's date as mm-dd <relurn>" 

8120 input "date";da$ 

8130 if len(da$)< = 5 and left$(da$,2)< ="12" 

andright$(da$.2)<= "31 " then8160 
8140 print"H'*invalid due dale*"" 
8150goto8l20 
8160en = sr 

8170ifd$='y" thenopen1,4 
81 80 i( du$(en)> = da$ then 8210 
8190pnntpl$(en};" ",du$(en);" "imiSfen);" is overdue 
8200 if d$ - ■ y ■ then printtfl ,pl$(en); " " ;du$(en); 

" "imi${en);" is overdue" 
8210:en = ld(en) 
8220 If enOO then 8180 
8230 printtab(1 1); 'B|« end of listing » " 
8240 if d$ = j ■' thenclosel 

8250 print " Jlpress <return> to return to main menu " 
8260 get cr$ 

8270 if cr$<>chr$(13) then 8260 
8280 return 

9000 rem- quit program, saving lists if necessary 
9010 iffl = Othen 19999 
9020 openi ,8.15 
9030 print#1 . ' sO linked lists " 
9040 close! 
9050c:$ = chf${13} 

9060 openi ,8,2, " OJinked lists, seq,w" 
9070 pnnt#1 ,s:c$;ul;c$;sr;c$;sa;c$;ss,c$;sf 
9080 for i = 1 to s 

9090 :print#1 ,plS(i):c$;du$(i);c$;mi$(i),c$:ld(i) 
9100 next i 

9110close1 

91 20 printlab(1 0); " lists have been saved " 

9130 goto 19999 

1 1 000 rem- locate and remove a vehicle 

1l010f2 = 

11020k = se 

1 1 030 If np$ - pl$(k) then 1 1 1 30 

n040ls = k 

11050k = ld(k) 

1 1 060 If kOO then 11030 

1 1070 pnnt^RjIale not found in list" 

1 1 080 print "Rj''6ss <return> to return to main menu " 



JM 
IP 
Bl 
Ml 
NC 
AP 
GC 
CH 
Al 
IM 
JO 
EA 
BD 
FN 
MK 
HA 
EJ 
JJ 
LN 
BL 
DO 
JG 
EH 
HB 
IN 
CB 
KF 
DN 
PB 
KL 
JA 

PA 

BC 
CN 
OK 
AH 

LI 

n 

ED 
JM 
ML 
OM 
MM 
AD 
AH 
FN 

HP 

BN 

KL 

GJ 

JF 

DH 

AH 

MB 

DL 

PJ 

KL 

PK 

IB 

IF 



11090 get cr$ 

1 1 1 00 If cr$<>chr$(13) then 1 1 090 

11110 f2 = 1 

11 120 return 

11130ifk<>sethen 11160 

11140 se = id(se) 

11150 goto 11170 

11160ld(ls) = ld(k) 

11170n = k 

11 180 return 

1 2000 rem- locate and remove a sold vehlcfe 

1201012 = 

1 2020 k = se 

12030 if npS= pl$(k) then 121 30 

12040 Is = k 

12050 k = ld(k) 

12060 If kOO then 12030 

1 2070 print " Hplate not found in list ' 

12080 print " ^ press <return> to return to main menu" 

12090 get Cf$ 

12100 it cr$<>chr$(13) then 12090 

12110f2 = 1 

12120 return 

12130 If kOse then 12160 

12140 se = [d(se) 

12150 goto 12170 

12160 ld(ls) = Jd(k) 

12170 ld(k) = sf 

12180 sf-k 

12190 return 

13000 rem- locate by mileage the proper location in list 

for a new element 
13010 k = se 

1 3020 if nm$< = mi$(k) then 1 3090 
13030 :1s = k 
13040 :k = ld{k) 
1 3050 If kOO then 13020 
13060 id(ls) = n 
13070 id(n) = 
13080 return 

13090 if kOse then 13120 
13100 se = n 
13110goto13130 
13120 !d(ls) = n 
13130ld(n) = k 
131 40 return 
1 4000 rem- locate by due date the proper location in 

list for a new element 
14010 k = se 

1 4020 if nd$< = du$(k) then 1 4090 
14030. Is = k 
14040 ;k = ld(k) 
14050 if kOO then 14020 
14060 ld{ls)-n 
14070 ld(n) = 
14080 return 

1 4090 if kOse then 14120 
14100 se-n 
14110goto 14130 
14120fd(ls) = n 
14130 fd(n) = k 
14140 return 



The Trcintoctor 



36 



Volume 5, Istu* 06 



A High Resolution 
Graphics Utility Fc 



Gary Kiziak 
Burlington, Ont. 



AO Co-J*AiJS 



There is no queslion regarding the superb graphic capabilities of the 
Commodore 64 - just look al the wealth of fine educational software 
and the unbelievable games that are now available. Yet most people 
are simply not able to make use of these capabilities when writing 
their own programs. Why is this? 

Actually, the answer is quite simple. Most people write their programs 
in BASIC, and unfortunately there are no commands that allow you 
access to these graphic capabilities other than PEEK and POKE. Of 
course there are some very good extensions to the language such as 
SIMON'S BASIC, the SUPER EXPANDER cartridge, and many more. 
These extensions provide additional commands that allow you to 
draw straight lines and circles, and to access the other graphics 
capabilities in a very simple way. The only drawback to using one of 
these extensions will arise if you plan to share any of your programs 
with others. For unless they have the same graphics package as you, 
they will not be able to make use of your programs. 

In this article, I will present a series of commands that will allow you to 
access some of the hires graphics capabilities of the 64 in a simple 
way. These commands will not be as comprehensive as the above- 
mentioned extensions, but they will be certainly more than adequate. 
Best of all, you can share it along with any of your own programs that 
make use of it. 

The commands will allow you to plot points, draw lines and boxes, 
and with a little help from BASIC draw circles, ellipses, etc. These 
drawings can take place on the normal hires screen or the more 
colourful multi-colour screen. You will even be able to print onto the 
hires screen, so that all your elaborate creations can be labelled using 
the built in character sets or even using custom character sets that you 
created. 

Some Preliminary Information 

The make-up of the normal text screen should be well known, but for 
completeness let's go through some of the delails. 

The text screen is made up of 25 rows, each containing 40 characters. 
Each of these 1000 (i.e, 25*40) 'character cells' can display a character 
in any of 16 difierenl colours. Within a single character cell however, 
only two colours can be displayed - the foreground or character 
colour and the background colour. The background colour must tie 
the same for all 1 000 locations, but the foreground colour can change 
from one character cell to another. 

To help locate particular cells, it is convenient to number the rows 
from to 24 and the columns from to 39 as in the figure below. 






tfuiJ av _M 



! 



A^ftDiO^ 










The text screen is fine for displaying character graphics, especially 
considering the 64's ability to place the character definitions in RAM 
where you can change the shape of the characters to virtually 
anything that you want. However for fine detailed graphics that 
involve the drawing of lines, circles, and other mathematical curves, 
there is a better solution - the HIRES screen. 

The hires screen is made up of 200 rows, each containing 320 dots or 
■pixels'. Each of these 64000 (i.e. 200*320] pixels can be turned 'on' or 
'off individually, allowing you to create very fine detailed pictures of 
enormous complexity. 

To help locale specific pixels, It is convenient to number the rows from 
to 199 and the columns from to 319 as in the figure below. 



^OO Pi^ tU 



to^O 



I ^ 



c 



3/V. 



I've chosen this particular numbering scheme because then we can 
think of the screen, in mathemahcal terms, as a Cartesian system, 
with the origin in the lower left hand corner. Any point on the screen 
can then be located by its (x.y) or Cartesian coordinates. 



CMaiC^LTf C Cf U- 



{o,.^^^ J-l — _ 




fx,V> 



C3'1 .111^ 



1 



Co.<^^ 



The Normal HI-RES Screen 



(^l^>o') 



1^ Th» Traniocfor 



37 



VolumoS, I»ue06 



For colour purposes, fhe hires screen is also arranged in a way similar 
lo (he normal text screen; that is, it can be thought of as containing 25 
rows and 40 columns of character cells'. Each of these character cells 
is 8 pixels wide and S pixels deep, just like a regular character. Also, 
like the normal text screen, a character cell on the hires screen can 
contain only two colours. The "off pixels can be one colour, and the 
'on' pixels another - these colours can of course be any of the 16 
colours available on the text screen. Unlike the text screen, the 
background colour (i,e. the colour of the W pixels) can change from 
one character cell to another as can the foreground colour. 

This limitation of two colours can be overcome at the expense of a loss 
in resolution by switching to multi-colour mode. In this mode, 4 
colours are possible within each character cell. Each coloured dot or 
pixel, however, is twice as wide as in normal hires mode. Thus the 
number of pixels across is 1 60. The vertical resolution is still 200. Also 
in this mode, the background colour must be the same for all 1000 
character cells. 

In multi-colour mode, more colourful pictures can be created, but the 
loss in resolution causes lines lo be more jagged and curves to be less 
smooth. It will be up to you to determine which mode is more suitable 
for your application. 



fo»'9l) 



r 



^!^ Ck.v) 



frf^Wf-l) 



(0,0^ 



iS^t^} 



The Multi-Colour Hl-RES Screen 



When this command is executed, the screen is cleared to the back- 
ground colour and any points that are subsequently plotted or lines 
that are drawn (see below) will appear in the colour determined by CI , 

It is also possible to turn on the hires screen without clearing it. The 
following line will do this. 

lOOSYSHIRES.O 

{i.e. leave off the background and plotting colour) 

This would be useful if your program needs to flip between the hires 
screen and fhe text screen and still retain any graphics on the hires 
screen. The first time you access hires graphics, you will, of course, 
want to clear the screen as well. 

If you want the multi-colour screen, use the following line 

100SYSHIRES,1,BG,C1.C2,C3 

where again BG is the background colour and CI , C2, and C3 are the 
three possible plotting colours (Remember, in multi-colour mode, 
four colours are possible in each character cell - the background 
colour, and three ploUing colours). For those interested in technical 
details, plotting colour CI corresponds to points plotted using the 
bitpair 01, C2 corresponds to the bitpair 10, and C3 corresponds lo the 
bitpair 1 1 , 

Turning on the multi-colour screen without clearing it is done by 

100SYSHIRES,1 

The graphics screen can be cleared at any time after the screen has 
been enabled by 



As I mentioned earlier, all the graphic capabilities are available in 
BASIC through a series of complex PEEKS and POKES. Aside from the 
complexity involved, the time required to execute a command can be 
unbearable (eg. 30 seconds lo clear the hires screen). Thus to be at all 
useful, the commands must be carried out in machine language with 
hopefully a simple interface to BASIC. 



100SYSCLSCR,BG,C1 



(in hires mode) 



and 100SYSCLSCR,BG,C1,C2,C3 (in multi-colour mode) 



2. Setting Plotting Colours 



Listing 1, isaBASICIoader that, when run, will create a PRG file called 
HIRES on your disk. This is the machine language program that will 
contain all the graphic commands. Type this program in carefully, 
save it, and run it. The loader program contains a ^check' every 10 
lines in an attempt to catch typing errors, but be careful, it is not 
foolproof, and a single typing error could make your program bomb. 
Listings 2, 3, and 4 are sample BASIC programs that make use of the 
commands. Before we look at these, let's go through the actual 
commands, their syntax, and the various options available. 



The background and plotting colours are set when hires mode Js first 
turned on. They may, however, be changed later on by the command 



200 SYS COLOUR, C1 



and 200SYSCOLOUR,C1,C2.C3 



(in hires mode) 
(in multi-colour mode) 



In multi-colour mode, all three plotting colours must be included 
even if you only want to change CI. 



1, Turning On The Hires Screen 



3. Selecting A Plotting Colour 



To turn on the hires screen, a line with the following syntax is 
required, 

100SYSHIRES,0,BG,C1 

In this line, BG is a number between and 15 representing the 
background colour of the screen (note: = black, I ^white, etc-) and 
CI is a number representing the plotting colour. Variables or numbers 
maybe used foreitherBGorCl, 



When graphics mode is enabled, colour CI is the default plotting 
colour. In multi-colour mode, you may wish to change to colour C2, 
or colour C3, or back to colour CI again. This is done by the command 

30DSYSSELPC,C 

where C = 1 if you want colour CI 

C = 2 if you want colour C2 

and C = 3 if you want colour C3 



Tha TkvnKictor 



Volumo 5, !<«#• 06 



If executed when in normal hires mode, this command is ignored 
since there is only one plotting colour CI . 

4, Setting The Drawing Mode 

Any plotting or drawing in hires mode can be done in any of three 
ways, 

ERASE mode - In this mode, the points and lines are erased rather 
than drawn (i.e. the pixels are turned off) 

DRAW mode - In this mode, all points and lines are drawn (i.e. the 
pixels are turned on) 

FLIP mode - In this mode, the condition of all points and lines are 
flipped (i.e. the pixels that are on are turned off and vice-versa) 

To set a particular drawing mode, simply include 

400SYSDMODE,M 

where M = if you want erase mode 
M = 1 if you want draw mode 
and fvl == 2 if you want flip mode 

5. Plotting A Point 

To plot a point a! coordinates (X,Y) (Remember: (0,0) is in the lower 
left-hand corner of the screen), use 

500SYSPLOT,X,Y 

The point will be plotted in the current pioltini^ colour (as selected in 
3. above) in the current drawing mode (as set by 4. above). If you wish, 

you can include up to two additional parameters. 

500SYSPLOT.XXC 

will select plotting colour C before plotting the point at (X.Y) and 

500SYSPLOTXY,C,M 

will select plotting colour C and drawing mode M before plotting at 
(X,Y), 

6. Moving The Drawing Cursor 

Whenever a point is plotted or a line is drawn, the drawing routines 
remembers the coordinates of the last point plotted. This point is 
called the drawing cursor, and is used in the DRAW TO command 
described below. It is possible to move the drawing cursor to a new 
position with coordinates (X,Y) and without plotting or drawing by the 
command 



600SYSIVlOVE,X,Y 



7. Drawing Lines 



This is the most versatile of the commands and offers the most 
options. 

(i) The DRAW command 

700 SYS DRAW.X.Y 



will draw a straight line from the current position of the drawing 
cursor (i.e. the last point plotted) to the point with coordinates (X,Y). It 
win also set the new position of the drawing cursor to {XX). The line 
will be drawn in the current plotting colour and in the current drawing 
mode. As with the PLOT command, the plotting colour and the 
drawing mode may be changed before the line is drawn by the 
addition of one or two more parameters; that is, 

700SYSDRAW.XXC 
will draw the line to (X,Y) in plotting colour C, while 

700SYSDRAW,X,Y,C,M 
will draw the line in plotting colour C and in drawing mode M, 
(ii) The DRAW . . . TO . . , command 

700 SYS DRAW,X1 .Y1 TO X2,Y2 

will draw a line from the point (XI ,Y1) to the point {X2,Y2) and set the 
drawing cursor to (X2Y2) (The initial position of the drawing cursor is 
ignored). As above, you can have 

700SYSDRAW,X1,Y1 TOX2,Y2,C 



or 



700SYSDRAW,X1,Y1 TOX2,Y2,C,M 



You can even have 



or 



700 SYS DRAW,X1 .Y^ ,0M TO X2,Y2 
700 SYS DRAW,X1 ,Y1 .C,M TO X2,Y2,D,N 



In the latter case, the C,M will, in fact, be ignored and the line will be 
drawn in plotting colour D and in drawing mode N. 

(lii) The DRAW ... TO ..• TO ... TO - - . command 

This feature makes this command similar to the HPLOT command on 
the APPLE, and allows you to draw a straight line from one point to 
another, then from that poinf to another, and so on. The syntax is , . . 

700 SYS DRAW,X1 .Y1 TO X2,Y2 TO X3,Y3 TO X4,Y4 

with as many points Xiyi as you can fit into a BASIC line. This 
command is useful for drawing shapes that can be made up of straight 
lines, eg. parallelograms, hexagons, etc. As above you can include 
,C,M anywhere after an Xi,Yi but keep in mind that it won^t take effect 
until the line is drawn to that particular point, 

8. Drawing Rectangles 

A rectangle may be drawn using the command 

800 SYS B0X,X,Y,W1DTH, HEIGHT 

where (X,Y) are the coordinates of the lop left-hand corner of the 
rectangle, and WIDTH and HEIGHT are the width and height of the 
rectangle respectively. As usual, you may optionally have 

800 SYS BOX,X,Y.WIDTH.HElGHT,C 



or 



800 SYS BOX,XXWIDTH.HElGHT,C,M 



Th« Transoctor 



39 



Volumes, Isiutt 06 



9. Re8toring The Text Screen 



1 1. Changing Character Sets 



If you wish to return to normal text mode from graphics mode, you 
can do so by 

900 SYS TEXT 

This will return you to the text screen with exactly the same condi- 
tions that prevailed prior to enlering graphics mode (eg, if you were in 
upper/lower case prior to entering graphics mode^ you will still be 
there when you return to text mode). Used in conjunction with the 
command SYSHIRES.O or SYSHIRES.l this can be used for flipping 
between the graphics screen and the lext screen- 

10. Printing To The Graphics Screens 



Text can be printed in upper case/ graphics, upper/lower case, and 
even a combination of the two (something that can't be done on the 
norma! text screen without using raster interrupts). It is even possible 
to print characters that you created with a character editor and stored 
in f^M. To print such characters, simply precede the printing with the 
command 

1 1 00 SYS CHSET, AD 

where AD is the address of the RAM character set. Because of the way 
character sets work, AD must be a multiple of 2048. Thus 

1100SYSCHSET,7-2048 



Text or character graphics can be printed to the hires screen using the would be required if your character set were stored in memory at 
PRNT command. For example, address 14336 ( = 7*2048), 



1000 SYS PRNT,C,R,A$ 

will print whatever is in AS onto the hires screen, starting in column C 
of row R. 



Note also that AD = will choose the ROM character set containing 
upper case and graphic characters while AD=1 will choose the 
upper/lower case characters in ROM. 



Notes, i . Printing takes place only in the 'character cells'. Therefore R 

and C are the row and column numbers as determined by the text 

screen, not the Cartesian coordinates on the hires screen (i.e. 0<^ R 

<= 24andO<= C<= 39with(0,0)infhe top left-hand corner of the 
screen). 

2. The siring to be printed may be a string variable, a string of 
characters between quotes, or even a string expression using MIDS, 
USFTi. or R1GHT$, The string expression may involve concatenation, 
for example: 

1 000 SYS PRNT,5,10,A$ -t- " DONE " 

but don't forget the' -(-'sign 

1000 SYS PRNT,5,10,A$i "DONE" 
will yield an error. 

3. The characters to be printed can be anything that you would 
normally use in a PRINT statement on the text screen, including 
cursor control characters such as cursor left, etc. , RVS ON/OFF. 
colour control characters such as CTRL-l (for white), etc. You can 
even use CNTRL-N to switch to lowercase and CHR$(1 42) to switch to 
uppercase. Only CLR and HOME for clearing the screen and homing 
the cursor are ignored. 

Cursor up and down work properly, but be careful when trying to 
cursor up beyond the top line of Ihe screen or down below the bottom 
line. Strange things will result, but the program will not crash. 

4- The text can be printed in either hires mode or multi-colour mode. 
In multi-colour mode, the characters will look a tittle funny and may 
be unreadable depending on the settings lor the three plotting col- 
ours. If you set CI and C3 to the colour you want the characters to be 
and C2 to the background colour, the characters are perfectly read- 
able. By changing C2 and C3, you can get some interesting effects (see 
the sample programs for an illustration}. The best solution is to create 
your own custom characters using a multi-colour character editor and 
use those characters instead (see below). 



12. The TRAP Command 

When drawing mathematical curves, errors such as 'division by zero', 
illegal quantity', etc. can quickly halt a program. When this happens, 
the TRAP command, which is the equivalent of the ONERRGOTO 
command on the APPLE, can overcome this. For example, 

1200 SYS TRAP.1500 

once executed, will cause control to be transferred to line 1500 
whenever an error occurs. The routine at line 1500 could then check 
for the type of error and take appropriate action. The important point 
is that the program will not stop unless you tell it to. 

To check for the type of error, include Ihe following in your error 
handling routine. 

1500X = PEEK(7S1) 

This will be the error number that would normally be passed on the 
BASIC interpreter- 

eg. if X = 20 then a division by zero error occurred 
if X=14 then an illegal quantity error occurred 
etc. 

The TRAP command can be disabled (i.e. the BASIC interpreter 
handles all errors} by leaving off the line number in the TRAP 
command, ie, 

1 300 SYS TRAP 

Caution: When an error occurs, the slack pointer can be in an 
unpredictable position. For this reason, before sending control to the 
line of your error handling routine, the stack is cleared. This Includes 
all Information about FOR . , . NEXT loops and RETURN addresses of 
subroutines. Thus after handling a specific error, you must not go into 
Ihe middle of a FOR . . . NEXT loop or the middle of a subroutine, 
even if that is where the error originally occurred. 



Th* Trariiactor 



40 



Volume 5, Iftsuft 06 



Listing 2 is a short demonstration proi^ram that shows how easy it is to 
make a pie chart. Notice how the HIRES routines are loaded in line 20, 
and the variables, that are the addresses of the various commands, are 
initialized in lines 120 through 150. 

At this time, there is no command for drawing circles in my routines. 
When it is complete, there will be such a command with the following 

syntax. 

SYS CIRCLE .XC.YC,XR,YR,SA,EA,INC 

where XC.YC are the coordinates of the centre of tfie circle 
XR IS the radms in the horizontal direction 
is the radius in the vertical direction 
is the starting angle in degrees (i.e. the angle with 
the horizontal where the plotting will start) 
is the ending angle in degrees {i.e. the angle 
where the plotting will end) 
is the increment in degrees 



YR 
SA 

EA 



and 



INC 



Note: The circle is drawn as a series of straight lines (and so is 
really a polygon}. INC determines how many sides this polygon 
has, and hence how 'smooth' the circle is. 

Since the command is not implemented yet, a BASIC equivalent is 
given in line 500 of listing 2. To draw a circle then, it is only 
necessary to initialize the variables XC,YC,XR,YR,SA,EA, and INC 

and then GOSUB500. 

Notice that to get a complete circle, the starting angle and the 
ending angle must be 360 degrees apart. Also by making INC 
equal to 120 degrees, 60 degrees, and 72 degrees, you can draw 
a triangle, hexagon, and pentagon respectively. 

Listing 3 is another demo that draws a bar chart, and illustrates 
what printing looks like in multi-colour mode. Experiment with 
lines 460, 480 and 520 and observe the effects. 

Listing 4 is a program that draws the graph of a malhematicat 
curve. When typing it in, put a REfvl in front of each TRAP 
command. This will allow you to debug the program more easily - 
otherwise the TRAP command will trap all your typing errors and it 
can become frustrating. 

The program draws the sinusoidal curve 

y = sin(2"x) + cos(3*x) {line 220) 

After the program is debugged, try drawing the curves 



or 

or 



y = 1/sin(x) 

y = sin(xycos{x) 

y = sqr(4-X'x) 



Try it with and without the REM statements in front of the TRAP 
commands. 

This program can be described as a general purpose drawing routine; 
that is, if will draw the graph of virtually any function. As such, it is 
somewhat slow. The plot can be speeded up by decreasing the 
number of plotting points (line 770) but this will also have a negative 
effect in that the curve will be more jagged. Special purpose routines, 
for drawing graphs that do not have undefined regions and for which 
all plotting occurs within the specified range will proceed much 
quicker. 



One Final Note On Memory Usage 

The hires screen is located at $E000 (I.e. underneath the kernal ROM). 
As such it does not steal any memory from BASIC. The routines 
themselves are stored in the $CO0O block from SCOOO to $C81E- 
Colour memory for the hires screen is located at $CC0O and extends to 
$CFFF. Since the DOS wedge also uses this area, these routines will 
not work with the wedge installed. Similarly, it may not work with 
other utilities that use the $C0OO block of memory. 

Listing 1 



BC 

HP 

LG 

BJ 

DG 

GL 

CI 

GO 



HI 
PL 
Jl 
BG 
PO 
AG 
JL 
10 
JC 
MP 
CH 
ID 
Dl 
lA 
HK 
FD 
MP 
Hi 
JM 
HM 
Ml 
PH 
JN 
PO 
FG 
GH 
HD 
GG 
GO 
FN 
KJ 
NG 
BC 
MG 
DP 
BC 
JC 
EJ 
GL 
ML 
GB 
FH 
BH 
BJ 
HK 
JJ 
NK 
JB 
EO 



100 open 1,8,15,"i0':close1 

110open1,8,1/@0;hires^ 

120print#1,chr$(0);:prinl#1,chr${192); 

130forj = 1 to 2080 

140 read X print#1,chr$(x); 

150chk = chk-Hx 

1 60 next j 

170 if chk<>245727 then print " has an error " : 

closel :end 
IBOclosel 

1 90 print " save successful ' :Gnd 
1000 data 76.194,193. 76,247,195, 76. 98 
1010data195, 76,110.194, 76, 30.194, 76 
1020data214, 196, 76,228.196. 76, 11,197 
1030 data 76, 67,197, 76,169.192, 76.206 

76,199.199, 76, 4,200. 



1040 data 197. 
1050 data 0, 
1060 data 0, 
1070 data 0, 
1080 data 0, 
1090 data 208, 
1100 data 208, 
1110data173. 



0, 0. 0. 0, 0, 0, 
0, 0,255.128, 0, 7,248 

0. 0, 0. 0, 0, 0. 

1, 0. 15,240,240. 0. 
0, 0, 0, 0,173, 58,192 

27,173, 0,221,141, 57,192 
24.208.141, 58,192,173. 17 
11 20 data 208, 141, 59,192,173, 22.208,141 
1130data 60,192, 32,110,192, 96,173, 
1140 data 3,201,231,208, 7.173, 1, 3 
1150 data201, 192, 240, 44,173, 0, 3.141 
1160data234, 192, 173. 1, 3,141,235,192 
1170 data 169, 231, 141, 0, 3,169,192,141 
llSOdata 1, 3.173, 2. 3.141, 41,193 
1190 data 173. 3, 3,141, 42,193,169, 8 
1200data141, 2, 3,169,193,141. 3, 3 
1210data 96,173, 58,192.240, 26,141, 24 
1220 data 208, 173. 57,192,141, 0,221.173 
1230data 59,192,141. 17,208,173, 60,192 
1240data141, 22,208,169, 0.141, 58,192 
1250data 96, 72,169,127,141. 13,220,165 



1 

1 

16 

44 

20 



1260data 1.141. 56,192, 41,253,133, 
1270 data 104, 96, 72,173, 56,192.133, 
1280data169, 129, 141, 13,220.104, 96, 
1290 data 3, 76.139,227.142, 13, 3, 
1300 data 76.192. 16,245,169, 0.133, 
1310 data 169, 0,133. 21,162,250,154,169 
1320 data 167, 72,169,233, 72. 76,163,168 
1330 data 32,169.192,173,234,192,141. 
1340 data 3.173,235,192,141, 1. 3,173 
1350data 41,193,141. 2. 3,173. 42.193 
1360dala141, 3, 3,169, 0,141, 76,192 
1370data 76.131,164,164,254,240, 13,160 
1380 data 0, 145, 251 , 200, 208, 251 , 230, 252 
1390 data 198, 254, 208, 243, 164. 253, 240. 10 
1400 data 136, 240, 5,145,251,136,208.251 
1410data145.251, 96, 32,201,192,160, 
1420data132,251,160,204, 132, 252, 160, 232 

1430 data 132, 253.160, 3,132,254, 32, 43 
1440 data 193. 169, 0,133,251,169,224,133 
1450data252, 169, 64,133,253,169, 31,133 
1460data254, 169, 0, 32, 43,193, 76,218 



ItwlMrtsoctor 



41 



VolumaS, I»utt06 





KG 


1470datal92, 32,253,174, 32,138,173, 32 


BF 


2170data 98,169, 0,245, 99,149, 99, 96 




PA 


1480data247, 183, 166, 21,165, 20, 96, 32 


DK 


2180data 21, 98,208, 4,149,106,149,107 




GC 


1490 dafa253. 174, 32,124,193,141, 43,192 


KP 


2190data 96,165, 99, 74,133,103,165, 98 




CF 


1500 data 142, 44,192, 32,121,193.141, 45 


MN 


2200 data 106, 133, 102, 24,169, 0,229, 98 




IF 


1510 data 192, 142. 46,192,169, 63,162, 1 


MA 


2210data133, 104, 169, 0,229, 99,133,105 




ID 


1520data 44, 53,192, 16, 4,169,159,162 


Al 


2220 data 96, 24,165.102,101,100,133,102 




BA 


1530 data 0, 205, 43, 192, 138, 237, 44, 192 


HL 


2230data170, 165, 103, 101, 101, 133, 103, 197 




LG 


1540 data 176, 3, 76, 72,178,169,199,205 


BC 


2240data 99,144, 19,208, 4,228, 98,144 




Ml 


1550 data 45,192,169, 0,237, 46,192,144 


NF 


2250data 13,138, 56,229, 98,133,102,165 




KF 


1560data241, 96, 32, 77,192, 32,121,193 


CC 


2260 data 103, 229, 99,133,103, 56, 96, 32 




PB 


1570data240, 2,169,128,141, 53,192, 32 


00 


2270 data 135, 193, 32,121, 0,240, 44.201 




FB 


1580data121, 0,240, 3, 32, 30,194,173 


DF 


2280 data 164, 208, 16, 32,113,194, 32,115 




GJ 


1590data 0,221, 9, 3, 73, 3,141, 


EM 


2290 data 0, 32,138,193, 32,121, 0,201 




Gl 


1600data221,173, 24,208, 41, 7, 9, 8 


NB 


2300 data 44,208, 13, 32,228,196, 32,121 




EF 


leiOdata 9, 48,141, 24,208,173, 17,208 


GP 


2310data 0,201, 44,208, 3, 32,214,196 




LG 


1620data 9, 32,141, 17,208, 44, 53,192 


EG 


2320data 32, 43,196, 32,121, 0,201,164 




Bl 


1630 data 16, 12,173, 22,208, 9, 16,141 


AC 


2330 data 240. 220, 96, 32,201,192,162, 




Gl 


1640data 22,208,169, 3,208, 10,173, 22 


PB 


2340 data 134, 2, 32,129,195,162, 2, 32 




IK 


1650data208, 41,239,141, 22,208,169, 7 


HO 


2350data129, 195, 165, 98,197,100,165, 99 




MA 


1660data141, 54,192, 73,255,141, 55,192 


LL 


2360 data 229, 101,144, 62. 32,185,195, 36 




10 


1670data169,255,141, 51,192, 96,169, 1 


ME 


2370data107, 16, 10, 32,113,194, 56,169 




ME 


1680data141, 65,192,173, 67,192,141, 66 


JJ 


2380data 0,229,108,133,108, 32,125,194 




KO 


1690datal92, 169, 128,141, 52,192, 32,135 


GE 


2390data 32, 14,195,230,104,208, 4,230 




JJ 


1700 data 193, 173, 45,192, 10, 10, 10, 10 


DB 


2400data105, 240, 102,238, 39,192,208, 3 




OD 


1710data141, 62,192,141, 70,192,173, 43 


EJ 


2410data238, 40,192, 32,209,195,144, 9 




AK 


1720data192, 41, 15,141, 61,192, 44, 53 


OM 


2420 data 24,173, 41,192,101,108,141, 41 




NO 


1730data192, 48, 12, 13, 62,192,141, 62 


JN 


2430 data 192, 32,125,194, 32, 14,195, 76 




HH 


1740 data 192, 141, 70,192, 76, 75,193,141 


MO' 


2440data 91,196,162, 1,181, 98,180,100 




MN 


1750 data 33,208, 32,121,193, 41, 15,141 


NC 


2450data149, 100, 148, 98,202, 16,245, 32 




AF 


1760data 63,192, 32,121,193,141, 64,192 


GO 


2460 data 185, 195, 36,107, 16, 10, 32,113 




HD 


1770 data 173, 62,192, 76, 75,193, 32,135 


HG 


2470data194, 56, 169, 0,229, 108, 133, 108 




JC 


1780 data 193, 162, 3,189, 43,192,157, 39 


DD 


2480data 32,125,194, 32, 14,195,230,104 




MM 


1790 data 192, 202, 16,247, 96, 56,169,199 


MA 


■ 2490 data 240, 31, 24,173, 41,192,101,108 




DD 


1800data237, 41,192, 72, 74, 74, 74,133 


LG 


2500data141, 41,192, 32,209,195,144, 8 




JF 


1810data252, 160, 0,132,251. 74,102,251 


KE 


2510data238, 39,192,208, 3,238, 40,192 




CD. 


1820 data 74, 102,251, 101,252,133,252,173 


LC 


2520dala 32,125,194, 32, 14,195, 76,166 




GJ 


1830 data 39,192,174, 40,192, 45, 55,192 


AE 


2530 data 196, 36,107, 16, 3, 32, 14,195 




HL 


1840 data 44, 53,192, 16, 6, 10, 72,138 


NH 


2540data 32,113,194, 76,218,192, 32,121 




DC 


M850dala 42,170,104, 24,101,251,133,251 


NB 


2550datal93, 41, 3, 73, 3,106,106,106 




AM 


1860data138, 101,252, 133,252, 104, 41, 7 


JC 


2560data141, 52,192, 96, 32,121,193, 41 




NF 


1870 data 24,101,251,133,251,133,253,144 


FJ 


2570 data 3,240, 27, 44, 53,192, 16, 22 




01 


1880 data 2, 230, 252, 165, 252, 74, 102, 253 


KM 


2580 data 141, 65,192,170,189, 61,192,141 




IH 


1890 data 74,102,253, 74,102,253,133,254 


KN 


2590data 70,192,189, 66,192,141, 66,192 




GC 


1900data 44, 53,192, 48, 16. 24,169, 


NF 


2600dala189, 7,197,141, 51,192, 96, 




El 


1910 data 101, 253, 133,253, 169,204,101,254 


PE 


2610 data 85,170,255, 32,121,193, 10, 10 




LB 


1920data133,254, 76,249,194,173, 65,192 


KA 


2620data 10, 10,141, 62,192, 44, 53,192 




BD 


1930data201, 3,144,234, 24,169, 0.101 


FK 


2630data 48, 9, 13, 61,192,141, 62,192 




GL 


1940 data 253, 133,253, 169,216, 101,254, 133 


CE 


2640data 76, 51,197, 32,121,193, 41, 15 




JD 


1950data254, 24,165,251,105, 0,133,251 


KG 


2650datal41, 63,192, 32,121,193, 41, 15 




JL 


1960 data 165, 252, 105,224, 133,252, 173, 39 


AD 


2660data141, 64,192,174, 65,192,189, 61 




MK 


1970 data 192, 45, 54,192,170, 96,169, 


AO 


2670data192, 141, 70,192,189, 66,192,141 




10 


1980dala168, 44, 52,192, 16, 4,112, 20 


AL 


2680data 66,192, 96, 32,110,194, 32,135 




EB 


1990dala 80, 15, 36, 2, 48, 9,169.255 


JL 


2690 data 193, 162, 3,189, 43,192,157, 47 




EE 


2000data133, 2, 36,107, 48, 1, 96,177 


EL 


2700 data 192, 202, 16,247, 32,121, 0,240 




CB 


2010data251, 77, 51,192, 44, 53,192, 48 


BF 


2710data 11, 32,228,196, 32,121, 0,240 




DA 


2020data 10, 61, 86,195,133, 97,189, 86 


IK 


2720 data 3, 32,214,196, 24,173, 39,192 




HD 


2030 data 195, 208, 8, 61, 94,195,133, 97 


ND 


2730 data 109, 47,192,141, 43,192,173, 40 




JD 


2040 data 189, 94,195, 73,255, 49,251, 5 


LA 


2740data192, 109, 48,192,141, 44,192,173 




EP 


2050 data 97,145,251,177,253, 45, 66,192 


EE 


2750data 41,192,141, 45,192,173, 42,192 




AG 


2060 data 13, 70,192,145,253, 96,128, 64 


OP 


2760data141, 46,192, 32,156,193, 32, 43 




DJ 


2070data 32, 16, 8, 4, 2, 1,192, 48 


HJ 


2770data196, 56,173, 45,192,237, 49,192 




EK 


2080dala 12, 3, 32,110,194, 32,121, 


PI 


2780data141, 45,192,173, 46,192,237, 50 




HO 


2090data240, 11, 32,228,196, 32,121, 


Nl 


2790 data 192, 141, 46,192, 32,181.193, 32 




MD 


21 00 data 240, 3, 32,214,196, 32,201,192 


GD 


2800 data 43,196, 56,173, 43,192,237, 47 




CI 


2110 data 32,125.194, 32, 14,195, 76,218 


LF 


2810 data 192, 141. 43.192,173, 44,192,237 




Bl 


2120 data 192, 169, 1 , 149, 106, 169, 0, 149 


BG 


2820data 48,192,141, 44,192, 32, 43,196 




AA 


2130 data 107, 56,189, 43,192,253, 39,192 


KJ 


2830 data 24,173. 45,192,109, 49,192,141 




CC 


2140data149, 98,189, 44.192,253, 40,192 


DM 


2840 data 45,192,173, 46,192,109, 50,192 




OA 


2150 data 149, 99, 16, 20,169,255,149,106 


AD 


2850data141, 46,192, 76, 43,196,169, 




BO 


2160 data 149, 107, 56,169, 0,245, 98,149 


GD 


2860 data 133, 251, 133,252, 32,241, 183,224 




Th* Trantattar 43 


Velum* 5, Uiw* 06 j 





HL 


2870data 40,144, 3, 76. 72,178,142, 73 


LC 


: 3570data 15, 32,110,192, 32,121,193,141 




KJ 


2880data192, 32,241,183,142, 74,192,138 


OC 3580data245,192, 142,249, 192,169, 128, 44 




GO 
IN 


2890dala240, 18,224, 25,176,237, 24,165 
2900 data 251, 105, 40,133,251,144, 2,230 


CE 


il 3590 data 169, 0,141, 76,192, 96, 0, 




^^^H 




P 


2910 data 252, 202,208.242, 24,173, 73,192 


LisUng 2 




MH 
IF 


?q?ndata101 251 133 251 133 253,133, 3 






2930data169, 0,101,252,133,252, 24, 72 


JO 


10 print"§|":poke 53280, 5:poke 53281,1 




NF 


2940 data 105, 216, 133, 254, 104, 105. 204, 133 


LF 


20 if peek(491 52)<>76 then load ' hires " ,8.1 




MM 


2950data 4, 6,251, 38,252, 6,251, 38 


CJ 


30: 




PK 


2960data252, 6,251, 38,252, 24,165,252 


HG 


100 rem initiaize variables 




PM 


2970data105, 224,133, 252, 32,253,174, 32 


CO 


110: 




PO 


2980 data 158, 173, 32,143,173, 32,166,182 


EF 


120hires=12*4096:draw = hi + 3.plot = dr + 3 




Kl 


2990 data 170, 160, 0, 232, 202, 208, 1 , 96 


CJ 


130 move = p +3:dscr = mo + 3:dmode = cl + 3 




HL 


3000data177, 34, 32, 73,198,200, 76, 60 


AC 


1 40 se pc = dm + S.colour = se + 3:box = co + 3 




NA 


3010dala198, 133, 215, 138, 72,152, 72,165 


DL 


150te>:t = bo + 3:prnt = te + 3:chsel = pr + 3:trap = ch + 3 




LM 


3020data215, 48, 17,201, 32,144, 28,201 


EB 


160: 




FH 


3030 data 96,144, 4, 41,223,208, 2, 41 


NJ 


170 rem begin the show 




FF 


3040data 63, 76,110,199, 41,127,201,127 


IC 


180: 




MO 


3050data208, 2,169, 94,201, 32.144,125 


MH 


190syshires.0,1,6 




JC 


3060dala 76,108,199,201, 14,208, 6, 32 


IJ 


200xc-159:yc=100:xr = 70:yr = 50:inc=10 




CI 


3070data219,199, 76,160,199,201, 17,208 


PG 


210sa = 45:ea=75:gosub620 




HC 


3080data 11,162, 40, 32, 71.199,202,208 


FD 


220sa = 75:ea=160.gosub620 




Al 


3090 data 250, 76,160,199,201, 18,208, 8 


BH 


230 sa= 160:ea = 240.gosub 620 




EF 


3100data169, 1,141. 75,192, 76,160,199 


El 


240sa = 240:ea = 325:gosub620 




JL 


3110data201, 29,208, 6, 32, 71,199, 76 


GA 


250 syscolour,7 




BF 


3120datal60, 199, 162, 3, 44,162, 15,221 


EG 


260 xc= 1 75:sa = -35:ea = 45;gosub 620 




FG 


3130data205, 198, 240, 6,202, 16,248, 76 


OB 


270 syscoour,9 




JO 


3140data160, 199,189, 221,198, 10, 10, 10 


LF 


2e0sysbox,6,170,307,165 




IF 


3150data 10,141, 62,192, 44, 53,192, 48 


EG 


290sysbox,3,172,313,169 




MK 


3160dala 6, 13, 61,192,141, 62,192, 32 


LA 


300syschset,1 




MM 


3170 data 51,197, 76,160,199, 5, 28, 30 


KP 


310 a$= "r" +chr$(30)+ "'Rent" .rem rvs + grn 




HE 


3180 data 31, 16, 28, 30, 31, 1, 21, 22 


DG 


320sysprnt,15,9,a$ 




CB 


3190 data 23, 24, 25, 26, 27, 1, 2, 5 


JG 


330 a$ = chr$(1 56) -+- " Food " :rem pur 




AA 


3200 data 6, 0, 4, 7, 3, 8, 9, 10 


KA 


340sysprnt,13,13,a$ 




Fl 


3210data 11, 12, 13, 14, 15,201, 14,208 


BO 


350 a$ =^ chrS(28) + " Clothes ' :rem red 


1 


PM 


3220 data 6, 32,216,199, 76,160,199,201 


PC 


360sysprnt,18J6,a$ 




IM 


3230 data 17,208, 11,162, 40, 32, 28,199 


LB 


i 370a$ = chr$(158)+ "Travel^ +chr$(142) :rem yel + 




KA 


3240 data 202, 208, 250, 76,160,199,201, 18 




upper/graphics 




IB 


3250data208, 8,169, 0,141. 75,192, 76 


DD 


380sysprnl,24,12,a$ 




Gl 


3260 data 160, 199,201, 29,208,143, 32, 28 


HC 


^^b d^b ^^ ^^ ^^ 

390a$ = chr$(154) + chr$(176 + XCCCCCCCCCCCCC 




NO 


3270 data 199, 76,160,199,165,253,208, 2 


1 


CCCCCCCCCCCCCCCCCCCCCCCC " -+-chf$(174) 




MC 


3280 data 198, 254, 198, 253, 165, 3, 208, 2 


GH 


400sysprnt0,0,a$ 

410a$ = chr$(221)+ ^[9spacesBH'^-L'^^^^^"^^^^® ^ 
+ chr$(28) + " Easyg 1 spaces B " 




MB 


3290 data 198, 4, 198, 3, 56, 165, 251 , 233 


M 




KM 


3300 data 8, 133, 251, 165, 252, 233, 0, 133 






BP 


3310 data 252, 165, 251 , 201, 0, 165, 252, 233 


CK 


420sysprnt,0,1,a$ + chr$(221) 




CO 


3320 data 224, 176, 3, 32, 71,199, 96,230 


LE 


430 a$ - chr$(1 73) + ' CCCCCCCCCCCCCCCCCCCCC 
CCCCCCCCCCCCCCCCC^ +chr$(189}+ "ffl" 




KN 


3330 data 253, 208, 2, 230, 254, 230, 3. 208 






PI 


3340data 2,230, 4, 24,169, 8,101,251 


CK 


440sysprnt,0,2,a$ 




DA 


3350 data 1 33, 251 . 1 44, 2, 230, 252, 165, 251 


AO 


450 get a$;if a$<>Ghr$(1 3) then 450 




GP 


3360dala201, 64,165,252,233,255,144, 3 


MM 


460 end 




EP 


3370 data 32, 28,199, 96, 9, 64,174, 75 


KE 


470; 




NG 


3380 data 192, 240, 2, 9,128, 32,165,199 


PE 


480 rem draw arc 




ID 


3390 data 160, 7, 32,230,199.177, 5,145 


OF 


490: 




Kl 


3400data251,136, 16,249, 32,245,199,200 


CI 


500 z1 =sa*n/180.z2 = ea*TT/180:z3 = Jnc*n/180 




HJ 


3410data173, 61,192, 44, 53,192, 16, 8 


N 


510x = xc + xr*cos{z1):y = yc + yr*sin(z1) 




BO 


3420 data 173, 64,192,145,253,173, 63,192 


JA 


520sysmove,x,y 




BJ 


3430data 13, 62,192,145. 3, 32, 71,199 


EC 


530fori-z1 to 22 step z3 




CC 


3440data104. 168,104, 170, 96,133, 5,169 


AM 


540 X = xc + xr*cos(i):y =^ yc + yr-sin(i) 




KH 


3450 data 0,133, 6, 6, 5, 38. 6, 6 


HC 


550 sysdraw.x.y 




GK 


3460 data 5, 38, 6, 6, 5, 38, 6, 24 


ED 


560 next 




IK 


3470 data 173, 71,192,101, 5,133, 5,173 


AD 


570 sys draw,xc + xr*cos(z2),yc + yr*3in(z2) 




KE 


3480 data 72,192,101, 6.133, 6, 96, 32 


AG 


580 return 




AA 


3490 data 253, 174, 32,138,173, 32,247,183 


CM 


590: 




ON 


3500datal66, 21,208, 9,165, 20,208, 3 


CN 


600 rem draw pie 




BA 


3510 data 162, 208, 44,162,216,142, 72,192 


GN 


610: 




LK 


3520data162, 0,142, 71,192, 96,173, 14 


FB 


620gosub500 




AN 


3530data220, 41.254,141, 14,220,165, 1 


LE 


630 sys draw.xc.yc 




IB 


3540 data 41.251,133. 1, 96,165, 1, 9 


EH 


640sysdraw,xc + xr*cos(z1),yc + yr*sin(z1) 




CM 


3550 data 4,133. 1,173, 14,220, 9, 1 


GK 


650 return 




GL 


3560data141, 14,220, 96, 32,121, 0,240 




1 ^ 


Iw1^n»acter * 


1 VolvmB S, iMua 06 | 



JO 

LF 

CJ 

HG 

CO 

EF 

CJ 

AC 

DL 

EB 

NJ 

IC 

JE 

Ml 

DJ 

PB 

JK 

NE 

GK 

BO 

AN 

FN 

KE 

BP 

JJ 

CG 

JC 

JD 

BA 

KC 

HL 

HC 

LG 

CG 

PE 

KA 

PI 

JP 

GM 

CK 

ND 

KL 

CK 

CD 

DO 

KA 

AH 

BK 

FE 



JO 

LF 

CJ 

HG 

CO 

EF 

CJ 

AC 

DL 

EB 

IK 

IC 

HA 

EP 

DM 



Listing 3 

10 print "H". poke 53280, 5:poke 53281,1 

20 if peek(49152><>76 then load " hires" ,8,1 

30: 

1 00 rem initialize variables 

110: 

1 20 hires = 1 2'4096:draw = hi + 3:p1ot = dr + 3 

130 move = pi + 3:clscr = mo + 3:dmode = cl + 3 

140 selpc = dm + 3:colour = se + 3:box = co + 3 

150text = bo + 3:prnt = te + 3:chseI=pr + 3:trap = ch + 3 

160: 

1 70 rem begin the shovj 

180: 

190syshires,1,0,1,2,6 

200 sys dmode.l :sys selpc.i 

210 sysdraw,33.168to33,87 to 133,87 

220 sys draw,33,S6 to 133,86 

230 for k = 1 to 5 

240 for j = 37 to 133 step 4 

250sysplot,j,84 + 16*k 

260 nextj,k 

270 for k = to 5 

280 y(k) = rnd(1)'80 + 88:c = rnd(1 )*& + 1 

290 syscolour,1,c,6 

300 for i = to 8 

310s = 43 + k*16 + i 

320 sys draw,s,88 to s,y(k),2 

330 next i 

340 next k 

350sysmove,34,88 

360fork = 0to5 

370s = 47 + k*16 

380sysdraw,s,y(k),3 

390 next k 

400 sys colour,!, 0,1 

410sysprnt,11,15, '79 80 81 82 83 84"* 

420 a$= "10 864 2" 

430fori = 1 to len(a$) step 2 

440 sys prnt,6,3+ i,mid$(a$,i,2) 

450 next 

460syscolour,2,0,2 

470 sys prnt.l 4,2, "annual sales" 

480syscolouf,0,0,6 

490 a$= "■ :fork=1 to 21 : aS=a$ + chr$(164) : next 

500 sys prnt, 9,17, a$ 

510 sysprnt,9,18,"Jb ar graphs 

520 syscolour,5,7,7 

530sysprnl,12,20,"are nice" 

540 sysprnt,2,22,"i n multi-color mode" 

550 get a$: if a$<>chr$(1 3} then 550 

Listing 4 

10 print "H" .poke 53280,5 poke 53281,1 
20 If peek(49152)<>76 then load "hires ",8,1 
30: 

1 00 rem initialize variables 
110: 

120 hires = 12-4096:draw = hi + 3.plot = dr + 3 
1 30 move = pi + 3:dscr = mo + 3:dmode = cl + 3 
1 40 selpc = dm + Scolour = se + 3: box = co + 3 
1 50 text = bo + 3.prnl = te + 3:chset = pr + 3:trap = ch + 3 
160: 

1 70 rem plot the graph 
180: 

1 90 X = X + dx: if x>xax then 650 

200 sys trap,400 : rem catch any calculation errors 

210 y = sin(2»x) + cos(3*x) : rem insert function to be 
graphed here 



Jl 

OP 

DB 

PR 

IH 

JP 

AJ 

GJ 

CE 

PO 

EL 

KN 

HP 

CN 

JD 

IE 

AP 

AL 

KA 

OA 

CM 

El 

MC 

IP 

AE 

PN 

CN 

MM 

ID 

EP 

BE 

Gl 
JD 

NF 
EK 
LL 
JA 

GC 

HN 
JD 
AC 
NE 
EP 
CH 
GL 
OJ 
MB 
FK 
AD 
MO 
MP 
BE 
AG 
BN 
KN 
PP 
PO 
CO 
ML 
AE 
OP 
OL 
MA 
LA 



220 
230 
240 
250 
260 
270 
280 
290 
300 
310 
320 
330 
340 
350 
360 
370 
380 
390 
400 
410 
420 
430 
440 
450 
460 
470 
480 
490 
500 
510 

520 

530 
540 
550 
560 
570 
580 

590 

600 
610 
620 
630 
640 
650 
660 
670 
680 
690 
700 
710 
720 
730 
740 
750 
760 
770 
780 
790 
800 
810 
820 
830 
840 
850 



sys trap,450 : rem now catch any plotting errors 

xp = (x-xin)«sx ;rem x-coordinate for plot 
yp = (y-yin)»sy ; rem y-coordinate for plot 
on pf goto 360,420 

L 
L 

rem last point was plotted ok, 

rem so draw from last point to current point 

sys draw, xp,yp 
goto 190 

rem last point was out of range, 

rem so draw from boundary to current point 

sys draw,xp,boundary to xp.yp 
pf = 0:9olo 190 

rem last point was not defined, 
rem so just plot the current point 

sysplot.xp.yp 
pf = 0.goto 190 

rem something went wrong with the function 

r 

err = peek(781):pf = 2 

if err = 1 4 then 1 90 : rem illegal quantity error 

if err = 20 then 1 90 : rem division by zero error 

if err = 1 6 then 1 90 ; rem overflow error 

if err = 1 1 then sys prnt,3,23, " syntax error 

in function definition " :goto 660 

sys prnt,4,23, "oops! i forgot about error # " 

-fstr$(err):goto660 

r 

rem tried to plot out of range, x-coord. should be o.k. 
rem therefore, just test the y-coord. 

err = peek(781 ) if errOl 4 then 520 

if yp>1 99 then boundary = 1 99 ; rem point is above 

top of screen 

if yp<Othen boundary = : rem point is below 

bottom of screen 

if pf = then sys draw,xp-dx,boundary 

pf=1:goto190 

rem end by pressing <return> 

r 
h 

sys prnt, 13,23, "graph completed" 
get a$:if a$<> chr$(13) then 660 
end 

rem begin the show 



xrn = -2*n 
xax= 2*71 
yin = -3.0 
yax= 3.0 



rem minimum value for x 
rem maximum value for x 
: rem minimum value for y 
: rem maximum value for y 



sx= 160/(xax-xin) rem scale in x direction 
sy = 200/(yax-yin) : rem scale in y direction 
dx = {xax-xin)/160 ; rem set inc for 160 point plot 
pf = 2 ; rem initialize plotting flag 

rem pf = , , . last point calculated was plotted o.k. 

. last point calculated was out of range 

ast point calculated was undefined 

; rem initialize x 



rem pf=1 
rem pf = 2 
x = xin -dx 



sys hires, 1,0, 1,0,1 

sys dmode,1 :sys selpc,1 

goto 1 90 



Th« 'h'cinscictor 



Volum* 5, l»utt 06 



VIC Parameters 

Chris Zamara, Technical Editor 
Program by Paul Higginbottom 



C64 Video and Character Memory Allocation 



The C64's flexible memory architecture and VIC-ll video chip 
allow you to set up screen and character memory practically 
anywhere you want to, providing the ability to re-define 
characters and alter the system memory map to your own 
specifications. The problem is, it's not such a simple process — 
as usual, there are just enough complications to create confu- 
sion. This article, the enclosed program C'VICPARMS''). and the 
tables below are calculated to ease some of that confusion. 

Fundamental Concepts 

The VlC'll video chip in the C64 generates a video display 
based on data found within the 64K of memory in the com- 
puter. When in regular text mode (the default after power-up}, 
there are two kinds of data needed to display characters on the 
screen: pointers which indicate which character is to be dis- 
played in each screen position, and a number of bytes which 
serve as shape tables to describe what each character looks 
like. 

The 1000 bytes which determine which characters are dis- 
played on the screen are collectively known as screen memory, 
video memory, or more technically, the video matrix. The 
default location of the video matrix is at 0400 hex ($0400 or 
1024 decimal), just below the BASIC text workspace, but that 
location can be changed at will. 

Everyoneofthepos5ible256 values of each video matrix byte 
has a character associated with it. The shape of that character is 
defined by the contents of 8 bytes within character memory. 
Since there are 256 characters it follows that character memory 
must occupy 2048 bytes. On the 64, as with all Commodore 
machines, there are two character sets available: upper case/ 
graphics, and upper/lowercase characters (these two sets are 
alternately selected with the shift/Commodore keys}. Alto- 
gether then, there are 4096 bytes which define the shape of all 
5! 2 characters. 

Character memory is normally found in ROM, at location 
$D000 (this is the same address range where the 1/0 is 
mapped, but either RAM or the character ROM can be mapped 
in instead). Like the video matrix, the start location of character 
memory (called the character base) can be changed. Of course, 
if you want to see legible characters on the screen, valid 
character definitions must exist in memory wherever the char- 
acter base points. To accomplish that, the contents of the 



character ROM starting at $DO0O can be copied into RAM 
wherever the new character base is. With the character defini- 
tions in RAM, you can customize the character set to your own 
specifications — that is the prime reason for changing the 
location of the character base. 

Allocating video and character data to different areas of mem- 
ory means pointing the VlC-ll video chip to the start of the 
desired memory addresses by changing one of its registers. In 
the case of the video matrix, it also involves setting a pointer so 
that the kernal (operating system) knows where the screen is 
located in memory. 

The start address of video or character memory can't just be 
anywhere; the video matrix must start on a IK boundary, and 
the character base has to start on a 2K boundary. In other 
words, there are 64 possible places where screen memory can 

go. and 32 possible places where the character base can start. 
Table 1 contains a list of all locations where screen memory can 
go, and table 2 gives the 32 possible character base locations. 

VIC Chip Banks 

In practice, selecting the memory areas for the video matrix 
and character base is complicated by the fact that the VIC chip 
has only 14 address lines and as such can access only 16K of 
memory. To allow full access of all 64K of RAM in the 64, the 
most significant two address bits from the VIC chip are pro- 
vided by two 1/0 lines (port A of CIA2). What that means to the 
programmer is that the video matrix and character base must 
lie within the same 16K boundary, since the VIC chip can only 
access one 16K "bank" at a time. 

Note the way the video tables below are organized into four 
columns; each column lists the possible memory addresses in 
each 16K bank. The default bank is 0, since the video matrix 
begins at $0400. How then is it possible to access the character 
ROM, which resides at $DO00, apparently in bank 3? 

Character ROM Images 

That feat is accomplished by a little trick in the 64's hardware. 
The character ROM appears at SDOOO only to the CPU — as far 
as the VIC chip is concerned (remember it can only access up to 
16K), it fetches its usual character definitions from $1000. 
However, the character definitions from $DO00 only appear to 



Th« 'h-ontacTor 



45 



Volume 5, l»iio 06 



iheVlC chip at $]000 in banks and 2, So ]i you were to put 
character definitions in RAM at $1000 or $5000. (he VIC chip 
wouldn't see them; it would still see the usual ROM character 
tabie. On the other hand, in banks 1 and 3 the VIC chip can get 
its character definitions out of RAM from any address within 
the 16K block, including the RAM at $D000 "under" the 
character ROM. To put it simply, the VIC chip will recognize 
character definitions from RAM starting at any 2K block in 
memory except at $1000, $1800. $5000 or $5800. Pointing the 
character base at any of these locations will result in displaying 
the default ROM characters. 

Selecting One of Two Character Sets 

As previously mentioned, there are two character sets defined 
in the ROM of the 64. The 2K of memory from $D000 to $D7FF 
contains the definitions for the upper-case/graphics character 
set which appears as the default after a reset or a RESTORE. 
The character definitions for the up per/ lowercase character set 
(which can be selected by simultaneously pressing the SHIFT 
and "Commodore" keys) are located in the next 2K of ROM. 
from $D800 to $DFFR To select one character set or the other, 
the kernal just flips the least significant bit of the character base 
pointer in the VIC chip to select an odd or even 2K boundary. 
This is worth noting because it means that the only way to set 
up two character sets and switch between them with the shift/ 
Commodore key combination is to start the character defini- 
tions on a 4K boundary. 

Specifics: How to Change the Pointers 

Both the video matrix and character base addresses within a 
given bank are defined with VIC register 24, which is at 
location $D018 (53272 decimal). The video matrix start loca- 
tion (one of 1 6 addresses within the bank) is dehned by bits 4-7, 
and bits 1-3 give the character base. The least significant bit is 
unused. In tables 1 and 2. the bit patterns necessary to select a 
given memory address appear in the rightmost column. 

The bank select bits are accessed through location $DDOO, 
which controls port A of ClAI. one of the two 6526 I/O chips. 
Bits and I of this location control the state of the most 
significant bits of the VIC chip address bus. The bits are 
inverted so that both bits set to selects bank 3, and both ] 
selects bank 0. The state of these bits necessary to select each 
bank is given in the top row of tables 1 and 2, 

It was mentioned earlier thai relocating the video matrix also 
involves changing an operating system pointer. This is so that 
BASIC will put characters in the right place when PRlNTing to 
the screen. Location $0288 {648 decimal) contains the page 
number of the video matrix in memory — iJ's normally set to 4, 
since the screen is at $0400. As another example, to relocate a 
screen to $4000 this byfe would have to be changed to $40 (64 
decimal). 



the CPU — it is fixed, and can't be put anywhere else. In fact, 
colour memory isn't a part of the 64K memory map at all, but 
exists in the form of a lone 1 K by 4 bit chip on the 64's circuit 
board. 

Another source of VIC chip display data that is moveable in 
memory is the high-resolution screen. This only applies in hi- 
res mode, where 8000 bytes are required for the screen. That 
means that there are two possible places in each bank where a 
hi-res screen can be located. As indicated in Table 3. bit 3 of 
location $D018 controls whether the hi-res screen comes from 
the lower or upper 8K of a given bank. 



The Easy Way Out: VICFARMS 

If it sounds like a real pain to re-define the character set and 
re-allocate video memory, try the program in listing 1. VIC- 
PARMS was originally written by Paul Hlgginbottom from 
Commodore, and it does the dirty work for you, VICPARMS will 
ask you where you want to put screen memory {the video 
matrix), and where you want character memory to come from. 
You must supply these addresses in hexadecimal. Given this 
information, VICPARMS will determine the correct values to 
store in the necessary locations, and whether or not the 
character set must be transferred from ROM to RAM. Before 
going ahead, it will display the steps it's going to take, and ask if 
it should proceed. Giving the reply '*y" at this point will initiate 
the action. If the character set must be transferred, it will take a 
few seconds before the process completes. 

When using VICPARMS, you have to keep in mind the informa- 
tion in table 1 and 2. You can only put screen memory or 
character memory at one of the locations designated in the 
table. Also, if you put screen memory and character memory 
close enough together so that they'll overlap, there's going to 
be problems. In short, VICPARMS works on a user-beware 
philosophy, but it does the job with a minimum amount of 
code; it's a programmer's utility, after all. 

When VICPARMS transfers character memory to RAM, it copies 
the 2K of character definitions which appear in ROM starting at 
$D000. This is the character set which defines the upper/ case 
graphics characters. If you want the alternate up per/ lowercase 
character set, change the variable "cset* in line 100 from to 1. 
Alternatively, you could change the program so that it copies 
both sets at once: change the '2047' in line 450 to '4095'. 

Once youVe relocated the character set to RAM, you can 
redefine the characters by simply POKEing about, with one 
exception: it character memory has been moved to JDOOO (the 
RAM under the character ROM and I/O) and the screen is 
somewhere else in bank 3 {$COO0 for example), the only way to 
change the RAM to redefine the characters is to "map out" the 
I/O. The IRQs will have to be disabled when doing this. 



It's worth mentioning here that there are other important But before getting too deeply involved in a discussion about 
memory areas to the VIC chip besides screen and character memory management on the 64 {which could easily fill another 
memory. There is colour memory, which appears at $0800 to article), let's leave it at that. 



Thvl^ctn factor 



46 



Vbluma 5, t»ua 06 



Tablet: Video Matrix 



Listing hVICPARMS 



Bank Select Register = $DD0O 

BankO Bank 1 Bank 2 Bank 3 

xxxxxxll xxxxxxlO xxxxxxOl xxxxxxOO 



Address Relative lo CPU 



0000 
0400 
0800 
OCOO 
1000 
1400 
1800 
ICOO 
2000 
2400 
2800 
2C00 
3000 
3400 
3800 
3CO0 



4000 
4400 
4800 
4C00 
5000 
5400 
5800 
5C00 
6000 
6400 
6800 
6C00 
7000 
7400 
7800 
7C00 



8000 

8400 

8800 

8CO0 

9000 

9400 

9800 

9C00 

AOOO 

A400 

A800 

ACOO 

BOOO 

8400 

B800 

BCOO 





$D018 




Contents 


cooo 


OOOOxxxx 


C400 


OOOlxxxx 


C800 


OOlOxxxx 


CCOO 


OOllxxxx 


DOOO 


OlOOxxxx 


D400 


OlOlxxxx 


D800 


OllOxxxx 


DCOO 


Olllxxxx 


EOOO 


lOOOxxxx 


E400 


1001 xxxx 


E800 


lOlOxxxx 


ECOO 


1011 xxxx 


FOOO 


UOOxxxx 


F400 


11 01 xxxx 


F800 


lllOxxxx 


FCOO 


llllxxxx 



(V means 'don't care") 



Table 2: Character Base 

Bank Select Register = $DDOO 

Bank Bank 1 Bank 2 Bank 3 

xxxxxxll xxxxxxlO xxxxxxOl xxxxxxOO 











$D018 


Address Relative to CPU 




Contents 


0000 


4000 


8000 


COOO 


xxxxOOOx 


0800 


4800 


8800 


C800 


xxxxOOlx 


1000(1) 


5000 


9000(1) 


DOOO 


xxxxOlOx 


1800(2) 


5800 


9800(2) 


D800 


xxxxOllx 


2000 


6000 


AOOO 


EOOO 


xxxxlOOx 


2800 


B800 


A800 


£800 


xxxxlOlx 


3000 


7000 


BOOO 


FOOO 


xxxx H Ox 


3800 


7800 


B800 


F800 


xxxxl 1 1 X 



(1) ROM image from SDOOO (upper case/ graphics) appears here 

(2) ROM image from SD800 (upper/lower case) appears here 

Nole: Bit 1 of SD018 is toggled by the shift/Commodore keys. 



Table 3: Bit Map Memory 

Bank Select Register = $DDO0 

Bank Bank 1 Bank 2 Bank 3 

xxxxxxll xxxxxxlO xxxxxxOi xxxxxxOO 



Address Relative to CPU 



0000 
2000 



4000 
6000 



8000 
AOOO 



COOO 
EOOO 



$D018 
Contents 

xxxxOxxx 

xxxx 1 XXX 



JF 
FL 
LA 
FJ 
AD 
BJ 
EC 
DA 



GP 

PK 
IN 
HG 
GK 



FO 

JG 

AK 

DO 

ID 

AD 

FP 

MD 

PE 

IL 

FF 

HO 

CB 

AF 

BJ 

LE 

PK 

DG 

00 

fC 
DA 
PI 
PJ 
FB 
AL 

CI 

OJ 

CO 

LF 

LF 

BM 
GA 
EC 
KO 

IG 
NH 
MH 

Jl 

Ml 
MD 

BJ 

GF 



10 rem* "vicparms" 

1 1 rem- this program allows you to 

12 rem* put your screen memory 

13 rem* and character memory 

14 rem* inany of the possible locations, 

1 5 rem* it will transfer the character 

1 6 rem* set from rom to ram if necessary 
19 rem program bypaul higginbottom 

20: 

100 csel = 1 :rem transfer: = upper/graphics, 

1 = up per/ lowercase 

1 1 print " (entries in hexadecimal) " 

120 a$= "screen addr'igosubSWisc^v 

130a$=" char.addr":gosub540:ca = v 

140 b = int(sc/1 6384) :rem screen bank # 

1 50 a = int(ca/16384) :rem char bank # 

1 60 sv = sc-b* 1 6364 :rem screen address 

1 70 cv = ca-a* 1 6384 : rem char address 

180 itsv = cvgolo 510 

190 rem error if screen and chars at same place 

200 if ((b = 1 )of{b = 3)) and (aOb) goto 51 

21 Oram error if in different no-image banks 

220 vic= 13*4096 :rem vie chip address 

230 c1 =13«4096+ 12*256 , rem cja chip 1 

240 c2 = 1 3*4096 + 1 3*256 :rem cia chip 2 

250 p = int(cv/2048)'2-+-int(sv/1024)*16:ifp<0 then 510 

260 rem char, screen loc in lo, hi nybble 

270 q = int(sc/256}:if q<0 then 510 

280 rem q is screen memory page for kernal 

290 print >okevic + 24/p 

300 print 'poke 648/ q 

310 r-(peek(c2)and252)or(3-b) 

320 print 'pokecia2, "r 

330if({b = 0)or(b = 2))and(((pand14)-4)or((pand14 = 6))) 

goto 350 
340 print " you need lo move the character set to: ' 

iprintca 
350 print:input "shall i do this" ;a$ 
360ifleft${a$,1)<>"y" then end 
370 poke Vic + 24, p 
380 poke 64e,q 
390 pokec2,r 
400ff((b = 0)or(b-2))and(((pand14) = 4)or((pand14 = 6))) 

goto 480 
41 rem transfer character set if necessary 
420 poked +14,peek(c1 + 14}and254:rem turn off irq's 
430 poke 1,peek{l)and251:rem see chars 

440 rom = vie + cset*2048 :rem character rom 
450fori = 0to2047:pokeca + i.peek(rom + i);next 

;rem move chars 

460 poke 1,peek(1)or4:remsee i/o again 

470 poked +14,peek(cl +14)or1: rem enable irq again 

480 print chr$(147); 

490 end 

500. 

510 print ''?illegal parameters" :end 

520: 

530 rem* input/convert subroutine* 

540 print a$::a$ = " " v = 0:input a$ 
550ifa$= ^" goto 540 
560 for 1= 1 to len(a$):a = asc(mid${a$,i))-48 
:a = a + 7*(a>9):v = v*16 + a:next 

570 return 



Thclh^nMctor 



47 



Volume 5, Ittuo 06 



BIGPRINT 

Program by Allen R. Mulvey, Fulton, New York 
Presented by Chris Zamara 

A True Proportion High-Res Printer Dump Utility 



Remember PICPRINT in the "Proleclion and Piracy^' issue (Vol 5, 
issue 03)? Well, Ihis one is better! In llie true spirit of program 
evolution (of which this magazine is a firm believer), a reader look a 
given program, added a dash of brilliance, and came up with a 
winner. 

To refresh your memory, PiCPRINT allowed you to view a high 
resolution picture in memory (at 2000 hex), and print the picture to a 
Star Gemini or similar printer, using the 64's function keys. The 
picture could be printed in a "wide mode" which stretched 
it out across the page; a wierd and perhaps less than useful feature. 
Alas, even Ihe "normal mode" printout served to stretch the picture 
slightly, since the aspect ratio (pixel width vs. height) of the printer 
differs from that of the screen. 

The good news: like Brainstorming, wierd concepts of no intrinsic 
value can spark thought. (Light bulb suddenly appears in thought 
bubble over man's head - Eureka!.) Which brings us back to 
BIGPRINT. When a ^Vide" picture dump is initiated (via the F3 key), 
the resulting picture takes up about the width of a standard printer 
page, but its height is also increased, so that the overall proportions 
match up quite well to those of the screen. Specifically, the big 
printout is 50 percent wider than the normal size and twice as high. 
Now why didn't 1 think of that? 

BIGPRINT retains the option of printing a "normal" sized picture, 
which it does in the same manner as PICPRINT. Some pictures are 
designed to look right on a printer rather than the screen, and look 
best printed in normal mode. 

After BIGPRINT is installed with SYS 49152, PT will toggle high-res/ 
text mode, F3 will print the picture in normal size, and F5 will give the 
big print. The stop key can be used to hall a picture in progress at the 
end of a line. 

The BASIC loader follows. Have fun with it, and keep those brain- 
storms coming in! 



Notes: 



1) Change the 76 in line 1030 to 121 to take advantage of the double 
speed print mode of the Star Gemini-lOx printer. 

2) The 4 in line \ 280 is the secondary address for the Cardco interface, 
and selects graphics mode with auto-linefeeds. You may have to 
use the no-linefeed graphics mode (5), depending on the DIP 
switch settings on your printer. 



CJ 
CA 

LI 
JM 

MJ 
PF 

JC 
GE 
EM 
CD 
BH 
MD 
Jl 
AC 
MJ 
OJ 
PG 
PK 
LJ 
FD 
BM 
HA 
IL 
NP 
LI 
LB 
FL 




^-C- O 




-y^.j^^^-^^ 



/-'" 



i' 



X 



% 



/ 



\ 



( 



\ 



/ 




; 



\J 



10 rem* data loader for "bigprint" 
1 5 rem« for star gemini printer and 

cardco interface 
20 cs = 
30 for i - 491 52 to 49639:read a:poke [,a 

:cs = cs + a;nexti 
40; 
50 if CS058931 thenprinf "•* error in 

data statements •***": end 
60 sys 49152 
70 end 
80: 

1000 data 76. 
1010 data 0, 
1020 data 32, 
1030data 27, 76,192, 
1040 data 64, 
1050 data 64, 
1060 data 64, 
1070 data 64, 
1080 data 59, 141, 
1090data141, 21, 
11 00 data 197, 201, 
niOdata 0,141, 
1120 data 234, 173, 
1130data169, 1,141, 4, 192, 165 
1140data197,201, 3,240, 35,201 
1150 data 6,208, 16,169, 3,141 
llSOdata 7,192,141, 45,192,169 
1170 data 0,141, 5,192, 76,143 



46,192, 0, 0, 

0, 7, 100, 128, 

16, 8, 4, 2, 



1, 
64, 

0, 
64, 



64, 
0, 

64, 
0, 

20, 
3, 



3, 

0, 

64, 

64, 




64 

1 
75 


64 
64 



27 

64, 

0, 

0, 

0, 120, 169 

3, 169, 192 

88, 96, 165 

64,208, 8, 169 

4,192, 76, 49 

4,192.208, 43 



Th* TrariMictor 



48 



Vblum« 5, If ■«• 06 



PO 

LM 

01 

GF 

BD 

DK 

EB 

Kl 

IC 

LA 

CB 

NM 

HB 

NA 

CF 

Fl 

BN 

CL 

FB 

BP 

DL 

EC 

DN 

CN 

DN 

EN 

LE 

JA 

EO 

NJ 

OE 

EC 



1180data192,201, 5,208, 8,169 
1190data 0,141, 7, 192, 76,143 
1200 data 192, 76, 49,234,173, 17 
1210data208, 73, 32,141, 17,208 
1220 data 173, 24,208, 73, 8,141 
1230 data 24,208, 76, 49,234,169 
1240data 0,141, 3,192,173,141 
1250 data 2, 41, 4,240, 5,169 
1260data255, 141, 3,192,173, 9 
1270 data 192, 32,195,255,173, 9 
1280 data 192, 162, 4,160, 4, 32 
1290data186,255, 169, 0, 32,189 
1300 data 255, 32,192,255,174, 9 
1310data192, 32,201,255,169, 
1320 data 133, 251, 169, 32,133,252 
1330 data 169, 27, 32,210,255,169 
1340 data 51, 32,210,255,169, 16 
1350 data 32,210,255,169, 25,141 
1360 data 42,192,173, 5,192,240 
1370 data 13, 56,165.251,233. 64 
1380 data 133, 251 , 165, 252, 233, 1 
1390 data 133, 252,162, 0,189, 18 
1400 data 192, 172, 7,192,208, 3 
1410 data 189, 22,192, 32,210,255 
1420 data 232, 224, 4, 208, 237, 169 
1430data 40,141, 43,192,169, 
1440 data 162, 7,157, 34,192,157 
1450 data 26,192,202, 16,247,162 
1460data 0,160, 0,177,251,141 
1470data 44,192,230,251,208, 2 
1480 data 230, 252, 173, 44,192, 57 
1490 data 10,192,240, 9.185, 34 



DJ 
CE 
MC 
OA 
FO 
JG 
NL 
CG 
LP 
KO 
HJ 
GB 
MC 
EA 
10 
AM 
GP 
GH 
LL 
DD 
GB 
HO 
MO 
NE 
OF 
BA 
CB 
LI 
AN 
CL 
JJ 
BJ 



1500 data 192, 29, 10,192,153, 34 
1510 data 192, 200, 192, 8, 208, 234 
1 520 data 232. 224, 8, 208, 21 6, 1 73 
1530data 7,192,240, 68,169, 7 
1540 data 141, 45,192.174, 5,192 
1550data189, 7, 192,141, 6,192 
1560datal60, 7,185, 34,192,174 
1570data 6,192, 61, 10,192,240 
1580 data 16,185, 26,192,174, 45 
1590 data 192, 29, 10,192,202, 29 
1600data 10,192,153, 26,192,136 
1610 data 16,226,206, 6,192.206 
1620 data 45,192,206, 45,192, 16 
1630 data213, 160, 7,185, 26,192 
1640 data 153, 34,192,136, 16,247 
1650 data 162, 0,189, 34,192, 77 
1660data 3,192, 32,210,255,172 
1670 data 7,192,240, 6, 32,210 
1680data255, 32,210,255,232,224 
1690data 8,208,231. 76,167,193 
1700 data 76, 6,193,206, 43,192 
1710 data208, 248, 169, 13, 32,210 
1720data255, 165, 197,201, 63,240 
1730data 27,208, 3, 76,218.192 
1740data173, 7,192,240, 12,173 
1750data 5,192, 73, 1, 41, 1 
1 760 data 141 , 5,1 92, 208, 236, 206 
1770 data 42,192,208,231,169, 27 
1780 data 32,210,255,169, 64, 32 
1790data210,255, 173, 9,192, 32 
1800data195.255, 32,204,255, 76 
1810 data 49,234 




"Mickey" by Coy V. Ison 
created with 'Picture Perfect', pnnted with BIGPRINT 



ThBlraniactor 



49 



Volum> 5, l»iua 06 | 



Two Short Sprite Editors 

Chris Zamara, Technical Editor 



The good thing about sprite editors is they make it easy to 
design your own sprites. The bad thing about sprite editors is if 
you don't have one, you have to type one in. 

Of course, that's only bad news if the sprite editor program is 
very long. And that will serve as introduction to the programs 
presented below. 

The sprite editors below work in different ways, but they share 
the same basic philosophy: why have oodles of code to allow 
cursor movement, character printing and deletion, etc. when 
the built-in BASIC editor will do all that just fine, thank you? 



Sprite Editor Number 1 

The first one is the shorter of the two, and a bit boring perhaps, 
but it works. The idea behind this one is to have the sprite 
definition contained within DATA statements. That way you 
can edit all the DATA statements on the screen, press RETURN 
over each one, then RUN the program to define and display the 
sprite. A bonus of doing it this way is that saving the program 
once a sprite is so defined also saves the sprite definition. 

Look at iisting I , Where are the data statements? The program 
shares a trait with a monster robot in an old Japanese sci-fi 
movie: it can ''program itself to enlarge" (honest, that's what 
the robot did in the movie). Enter the program, then RUN 300. 
Lines 1000 to 1020 will be added to the program, and will be 
listed for your convenience. Each period between the quotes in 
(he DATA statements represents one pixel in the sprite Change 
a dot to anything else (I like asterisks) to set the corresponding 
sprite pixel. You'll have to press RETURN over each line to 
enter it (the program sets auto-repeat on all keys so just start at 
line 1000 and hold down the RETURN key to enter all lines). 

When you want to see the sprite, RUN the program; the newly 
defined sprite will appear at the top left corner of the screen. To 
continue editing, LISTIOOO- or just LIST to display the current 
DATA statements. The sprite is defined at sprite page 13 which 
is location 832. Thus, the bytes stored from 832 to 895 com- 
prise the sprite definition, and may be written to a disk file or 
otherwise saved in lieu of saving the sprite editor program with 
the DATA statements. Sure, it's primitive, but it works, and the 
program is only 20 lines long. The main inconvenience is that 



you can't see the sprite dynamically change as each point is 
changed; you have to RUN the program each time to see the 
new sprite, and the re-definition process isn^t quick. Enter 
Sprite Editor ^^2, 



Sprite Editor Number 2 

This one is a bit longer, but much more exciting. The sprite 
definition process occurs dynamically, as you plot or erase each 
point- It can be fun to use, since the routine is in t err upt-d riven 
and you keep complete control over the machine while you 
define the sprite by putting asterisks on the screen. RUN it 
(leaving out the opening REMs if you wish), and after a few 
seconds, an array of dots will be printed starting at the top left of 
the screen. After the dots appear, the computer returns to its 
normal state - you are free to enter commands, edit or LIST a 
program, whatever. But try changing some of the dots to 
asterisks. As asterisks are entered in any of the indicated screen 
locations, the sprite is instantly updated and displayed at the 
right of the screen. Unlike program one. you shouldn't press 
RETURN over each line or you'll get a syntax error - use SHIFT/ 
RETURN instead. The dots which are printed aren't really 
important at all, but they serve as a guide to the boundary of the 
sprite definition area (24 characters across by 21 down). 

Remember, once the program has been RUN, any change in 
the sprite definition field on the screen will affect Jhe sprite, ff 
you were to LIST the program for example, you'd see the a 
funny looking sprite form, and then appear to "scroll" upwards 
with the program listing. As the asterisks in the program listing 
move across the sprite definition field, the sprite continuously 
changes to reflect the new asterisk pattern. Of course, listing is 
slowed down considerably, since the interrupts are stealing so 
much time. 

When you've played around enough to come up with a sprite 
you're happy with, you can disable the interrupt-driven sprite 
program and print out the 64 bytes defining the sprite by 
entering CONT This command appears below the dots which 
are printed out. so you can just move the cursor over the CONT 
and press RETURN. After the values have been printed out, the 
interrupt routine can be re-enabied with SYS 49152, and 
disabled with SYS 49165. 



Tho Trantactor 



50 



Volum« 3, 1siu9 06 



Both programs can be embellished to give more features, for 
example multi-colour sprite capability. Even if the programs 
grow to the point of belying their calling in life (being small), it 
doesn't matter. Somehow, it seems easier to write a huge 
program than to lype someone else's program in. 



Listing for Sprite Editor *1 



KJ 
NP 
FD 
KL 
OC 
PJ 
PJ 
LJ 
BG 
BK 
EM 

PC 
CN 
BN 

IE 

BD 

CE 

Fl 
CN 

Dl 

EF 



1 00 rem* simple sprite designer ♦ 
1 1 sp = 1 3 , rem sprite page 
120s = sp»64:rem sprite position 

130poke2040,sp 

1 40 V = 53248:pokev + 21 ,1 :rem display mob 

1 50 pol<ev + 39,1 :pokev,25:pokev + 1 ,51 

160 fori = Oto7 e(7-i) = 2ti:next 

165 poke 650,1 28: rem repeat all keys 

1 70 : rem convert data to mob 

1 80 fori - 1 to21 ;reada$:forj - 1 to24step8 

1 90 V = O:fork = 0to7: ifmid$(a$,j + k, 1 )<> " . ' 

then V = V + e(k) 
200 next k:pokes,v:s = s+1:nextj,i 

210 end 

220 :rem add data statements 

300ifa>20thenlist1000- 

310 print chr${1 47)1 000 + a " data " ; 

31 5 print chr$(34) " " chr$(34) 

317 rem 24 periods 

320 a = a + 1 :prinl ' a = " a" :goto300 " 

330poke198,3:poke631,19:poke632,l3:pake633,13 

340 end 



OA 
OJ 
CB 
LI 
BN 
OE 
EB 
HG 
GE 
EN 
IP 
Dl 
DJ 
HL 
CI 
ME 
KH 
IC 
AH 
BIVl 
AK 
AE 
El 
OJ 
HG 
01 
EG 
MH 
DD 
JG 
KN 
BP 
OF 
DE 
EH 
BF 
DE 
KO 
Bl 
EM 
NH 
BP 
AL 
CO 
00 
CH 
EH 
CH 
LC 
DE 



Usting for Sprite Editor *2 



100 rem* » easy sprite editor « ♦ 
1 10 rem • -use normal editor to draw. • 
120 rem • -use " * " to plot points. * 
130 rem • -press return over "cont: ' ♦ 
140 rem* to print sprite values, • 
150 rem* aug84 ~C2— • 

160: 

170 fori =491 52to49278:reada:pokei,a;next 

210: 

220 rem * display sprite #1 3 (at 832) * 

230 V- 13*4096 

240poke2040,13 

250 poke v,30: poke v + 1 , 1 00: poke v + 1 6, 1 

260 poke v + 21,1: poke v + 39,1 

270: 

280 rem • print design grid • 

290 print chr$(147);:fori = 1to21 

295 print" ":nexti 

296 rem 24 periods 
300 print "cont:" 

31 sys491 52: rem ♦ enable sprite draw 

320 end 

330 rem • "cont' executes the following 

340 sys491 65: rem • disable sprite draw 

350 print chr$(1 47) 

360 rem * print sprite values " 

370 fori = 832to895:printpeek(i) ' , " ,:next 

380 end 

1000data120, 169, 37,141, 20, 3 
1010data169, 192, 141, 21, 3, 88 
1020 data 96,120,169, 49,141, 20 
1030 data 3,169,234, 141, 21, 3 
1040 data 88, 96,128, 64, 32, 16 
1050 data 8, 4, 2, 1, 0. 
lOBOdata 3,169, 0,133,251,169 
1070 data 4,133,252,162, 0,169 
lOSOdata 3,141, 35,192, 32,101 
1090data192, 173, 34,192,157, 64 
11 00 data 3,169, 8,141, 36,192 
1110data206, 35,192,208. 10,169 
11 20 data 3.141, 35,192,169, 24 
11 30 data 141, 36, 192, 165,251, 24 
1140 data 109, 36.192,133,251,144 
11 50 data 2,230,252,232,224, 64 
1160data208. 210, 76, 49,234,169 
1170data 0,141, 34,192,160, 7 
1180 data 177, 251, 201, 42.208, 9 
1190data185, 26,192, 13, 34,192 
1200data141, 34,192,136, 16,238 

1210 data 96 



Th* l^anMctor 



51 



VplumaS, l*»u«06 



A List Scrolling 
Routine For The C64 



Darren James Spruyt 
Gravenhurst, Ontario 



Dig out program lines from beyond the screen limits ! 



Listing 1 : BASIC loader for scroll routine 



This program allows yoti lo scroll both forwards and 
backwards through a BASIC program on the screen using 
the cursor up/down keys. It saves countless typings of 
'UST and having to press the RUN/STOP key at the 
correct time. 

The operation is very simple: after you have run the 
BASIC loader program (Listing 1), give the enabling 'SYS.' 
To scroll backwards through the listing, place the cursor 
on the top row of the screen and press cursor up. If the 
screen has no numbers along the left hand side, the listing 
will start from the very last line of the program. Con- 
versely if you are at the bottom of the screen (with no line 
numbers on the screen) and press cursor down, the listing 
will start with the first line in the program. 

If line numbers appear on the screen, upwards scrolling 
will list the line previous lo the number closest to the top 
of the screen, and if scrolling down, the line number that 
follows the one closest to the bottom of the screen will be 
listed. 

One note; Be sure to stop a real list before pressing the 
cursor down, or else nasty things may happen. That is. if 
you typed XIST 100-', press the RUN/STOP key before 
trying to scroll down the listing. 

Listing \ is the BASIC loader for LIST SCROLLER, while 
hsting 2 is a disassembly of the program. A few notes; The 
vector at ($0300) is the 'ERROR MESSAGE LINK', and all 
errors pass through this vector as well as the list routine 
when it is finished. This vector is changed so that the 
program can regain control after a line has been listed or 
when an error occurs during line number fetches. 

The programming method used could be denoted 'POST- 
INTERRUPT' - that is, when an interrupt occurs, a little 
pre-interrupl code is done, then the system interrupt code 
is performed (keyboard scan, updating Tl$), and finally, 
control is returned to the post-interrupt routine before the 
interrupt returns. The advantage over a simple pre- 
inlerrupt technique is that the program can check if 
certain keys are pressed before the screen editor even 
knows they exisl- 



CC 
LI 
BF 
DH 
GK 
LJ 

CI 

AF 

IN 

IB 

DC 

EJ 

OE 

PC 

NH 

NP 

DJ 

BR 

LL 

HB 

ID 

JK 

CF 

AA 

LN 

AP 

BP 

CC 

CA 

GG 

MM 

HC 

AC 

GG 

KG 

KF 

HH 

DH 

GH 

OG 

DL 

KK 

OG 

GO 

AA 



3, 141, 43 

3, 141, 44 

21. 3 

3, 169 

88, 96 

3, 76 

48. 3 



rem* data loader for "scroller" ^ 

20cs = 

30 for i = 51 456 to 52049:read a;poke i,a 

40cs = cs + a;nexti 

50: 

60jfcs<>73817then 

print" *"■** error in data statements 
70 rem sys 51 456 
80 end 
100: 

1000 data 120, 173, 20, 
1010data201 J73. 21, 
1020data201, 169.201, 141, 
1030 data 169, 30, 141, 20, 
1040data 0, 141, 67,203, 
1050 data 44, 67,203, 16, 
1060 data 126, 234, 165, 157, 
1070 dala 76, 49,234,169,255,141 
1080 data 67,203,160. 5,104,153 
1090data 69,203,136, 16,249,160 
llOOdala 73,169,201, 72,152, 72 
1110 data 8, 72, 72, 72, 76, 49 
11 20 data 234, 164,198,240, 13, 185 
1130data118. 2, 162, 1,221, 60 
1 1 40 data 203, 240, 6, 202, 1 6, 248 
1150data 76,159,202,165,214,221 
1160 data 62,203,240, 3, 76,159 
11 70 data 202, 142, 77,203, 
1180 data 202, 32, 25,203, 
1190 data 202, 198, 198, 174, 
1200 data 224, 0,208, 3, 
1210data202, 162,255,232,224, 25 
1220data240, 11,181,217, 16,247 
1 230 data 32, 229, 202, 1 44, 242, 1 76 
1240 data 6,169,255,133, 20,133 
1250data 21, 32, 19,166,164, 95 
1260data228, 44,208, 7,196, 43 
1270data208, 3, 76.156,202,202 
1280data228, 44,176, 5,166, 44 
1290data164, 43,136,134, 64,132 
1300dala 63,160, 0,177, 63,240 
1310 dala 6,200,208,249, 76,156 
1320data202,200,177, 63,197, 95 
1330data208,243,200,177, 63,197 
1340 data 96,208,236,136,152, 24 
1350data101, 63,133, 95,165, 64 



* t *4H 



32, 178 
32,187 
77, 203 
76, 4 



end 



Tho Transoctor 



53 



Volume 5, l»u« 06 



NF 

IL 
JM 

JL 
MK 

MJ 

BO 

DF 
CG 

lA 

DA 
MG 

FG 

Al 

NE 

IB 

LK 

E 

GB 

FB 

KH 

FF 

DL 

JP 

LM 

AO 

KJ 

FL 

HP 

FK 

BK 

FG 

CM 

NC 

KG 
10 

BA 

HG 
EP 
CL 

GE 

DB 

OL 

EA 

JD 

BG 

CI 

OH 

BN 

PG 

BK 

BG 

NN 

Kl 

AJ 

KH 

NJ 

AO 

FH 

LE 

LB 

KA 

IB 



1360dala105, 0J33, 96J62, 24 
1370data181,2l7. 48, 5.162, 23 
1380 data 32,255,233,162. 0, 32 
1390 data 104, 233. 165, 217, 9, 128 
1400 data 133. 217, 169. 39,133,213 
1410 data 162. 1.142.146. 2,202 
1420data134,214, 32,240.233. 76 
1430 data 85,202.162, 25.202, 48 
1440data 11,181.217. 16,249, 32 
1450 data229. 202, 144.244, 176, 9 
1460 data 169, 255, 133, 20.133. 21 
1470 data 72,208, 21,224, 24.208 
1480 data 4,169. 13,208,245,224 
1490 data 23.208. 5.232,181,217 
1500 data 16.243,169.255.208.232 
1510data230, 20,208, 2.230, 21 
1520 data 32, 19.166,165,218, 48 
1530 data 9, 9,128,133,218,162 
1540 data 1. 32,255,233.162. 24 
1550data134,214, 32,240.233.104 
1560 data 48, 3. 32,210,255,160 
1570 data 1.177. 95,240, 37,141 
1580 data 64.203,169. 0.145. 95 
1590data132, 15,165, 95.133. 63 
1600 data 165, 96.133, 64,169,255 
1610data133. 20,133. 21, 76.215 
1620 data 166, 224, 11.240, 26.173 
1630 data 64,203.160, 1,145, 63 
1640 data 169, 13, 32.210,255, 32 
1650 data 202, 202. 32. 47,203.169 
1660 data 0,141,146, 2. 76,159 
1670data202, 104.104, 104, 104, 76 

1680 data 128. 202, 230. 198, 76,133 
1690 data202. 160, 0.185. 69.203 
1700data 72,200,192, 6,208,247 
1710data169, 0,141, 67.203, 76 
1720 data 129. 234, 174. 135, 2, 165 
1730data206, 32, 19,234, 96,165 
1740data214, 141. 75,203,165,211 
1750dala141. 76,203.169, 0,133 
1760 data 211, 96,174, 75,203.134 
1770dala214, 173, 76.203,133,211 
1780 data 32.108.229.160, 0,132 
1790 data 207, 140. 140, 2, 200. 132 
1800data205, 140.139, 2, 96, 32 
1810data240.233. 160.255, 200. 177 

1820data209, 192, 39.240. 38,201 
1830 data 32,240.245,201. 48,144 
1840data 30.201, 58,176, 26.152 
1850data 24.101,209,133.122,165 
1860data210, 105. 0,133,123, 32 
1870data121, 0.142. 68,203. 32 
18e0data107.169, 174, 68,203. 56 
1890 data 36, 24, 96,160, 1,185 
1900 data 0, 3.153, 65,203.136 
igiOdata 16,247,169,117,141, 
1920data 3,169.202,141. 1, 3 
1930data 96.173. 65.203,141, 
1940data 3,173. 66.203.141, 1 
1950 data 3, 96. 17,145, 24, 
1960data 12,139,227, 0, 23,173 
1970 data 215, 224, 137, 97. 0, 24 
1980 data 0. 0. 65. 65, 65, 65 



Listing 2: Commented Disassembly 



c9005ei 
cQOIIda 

c907lda 

c90dlda 

cSOfsta 

cdl2lda 

c9UBta 

□91 7 Ida 

c9l9sla 

cSlccli 

c9ld^ls 

cSlebd 

C921 bpl 

c923 fJ^p 

C926lda 

c92abmi 

c92aimp 

c92dlda 

c92t5ta 

c932 Idy 

C934pla 

c935Gla 

c936cley 

c939 bpl 

c93bldy 

c93dlda 

c93< pha 

c940rya 

c941 pha 

c942 php 

c943 pha 

c944pha 

c945pha 

C946rmp 



E0314 

Sc92b 

S0315 

Sc92c 

•£g9 

S0315 

#Sle 

50314 

#S00 

Scb43 



Scb43 
Sc926 
Sea7e 

39d 

$c92d 

Sea3l 

#Sft 

ScM3 

*S05 

S<:b45,v 

5c934 

r$49 

i*3c9 



Sea31 



c949ldy Sc6 
c94bbeqSc96a 
C94dlda S0276,v 

c950ldx #$01 
c952cmpScb3c,x 
C955 beq £c95d 
c957 dex 
cQSSbpl Sc952 
c96afmp 3ca9f 
c95dlda $d6 
c95t crnpScb3©,* 
c962 beq Sc967 
c964 imp lca9t 
c967srK SGb4d 
c9ea [sr Scab2 
c96d|Br $cbl9 
c970 \st Scabb 
c973dec»c6 
c9?5ldj. icb4d 
c97acpx 1*500 
c97abne$c97t 
c97cjrnpSca04 
c97t Idx n%n 
c9d1 inx 
c9S2cp)iilSl9 
i:9B4beq£c991 
cQSeida Sd9.< 

c9aabpi Scsei 

cQflajSr Scae5 
c9Bdbcc$c991 
c9Sr bcs $c997 
c991 Ida ffSft 
c993sla 114 
C995sla S^5 
c997|sr Sa6l3 
c99aldy $5f 
c^gccpx S2c 
c99e bre Sc9a7 
c9a0 cpy S2b 
c9a2 bne Sc9e7 
C9a4|mp$ca9c 
c9a7 dex 
G9a3 cph S2c 
c9aa bcs Sc9bl 
c9acldx S2c 
^aeldy $2b 
c9bOdey 
c9bl SIX $40 
c9b3sly $31 
c9b5ldy #SO0 
c9b7lda fisn.y 
C9b9 beq £g9c1 
c9bbiriy 
c9bc bne Sc9b7 
c9bejt[ipSca9c 
c9cl my 
c9c2lda [$3f),y 
c9c4 cinpISt 
c9c6 br>e $c9bb 



llochouT irq's 
-copy old irq to 
;use in the exii 
.roulire 

.sel new irq vector 



:sel processing To 
.ran acliv« mode 



^processino active' 

,no 

,skip out quick 

,in immediaie mode 

,yes 

.oiher^iss exil 

,aei processing lo 

,ihe active siata 

.remove sjx bytes 

;frorn the stack, 

,pul UiBfe 

,ty the 

interrupt routine 

,seE up false irq 

.relurn 

; vector and put 

-rl onto the 

;stack 

Lpu&h lalse sialus 

ipush 3 more 

; dummy values onto 

;trie stack 

,conf with inierfupf 

Lconirol returns to 

;herewhen irq done 

;get # cfiars n bul 

.empty 

gel last char 

h 

.clieck against 
.Ihe wanted cTiars 



,no matches 
.cursor row 
,cf>eck against row 
:needed to execute 
,no match here 
.up'downflag 
erase cursor 
,char^ge($0300) 
.save cursor pos 
■purge frorr>bijf 
:rvpe up/dwn 
:dcwn number 
,nolequ-al- up 
:[mp 10 cursor down 
.start of cursor up 

T 

.Checked all lines 

.yes 

gel link 

.line's linked retry 

.Iry to lir*en umber 

none present 

,skip over 

-set 'or lop 

;iTiost hne 

to be fOurTd 

.find line 

Jo byte 

.compare with Siarl 

;ol basic hi 

.compare wilh Start 

;of basic lo 

,no previous lines 

;check V lowei" thari 

;5tartot basic 

.nol at all 

.corfect rf lower 

•.\h&t siart of basic 

;set up indiiecl 

;^l to search 
,lor a zero byle 
-meaning end of line 

.nomasch 
;lry tor next 
,no more ciiances 
-check Itie value 
:against ttie link lo 

;fmmaTch. reiry 



cScemy 

c9c9lda (S3f).y 
c9cbcmpS60 
c9cdbneSc9bb 
c9cf dey 
cSdOlya 
cSdlck: 
c9d2adcS3r 
c9d4s(a S5f 
c9d6lda S40 
c9d6adc#$O0 
c9dasia $60 
cSdcldx #S18 
c9deJda Sd9.x 
c9e0 bmi Sc9e7 
c9e2ldx #317 
c9e4|sr $g9M 
c9e7ldx #S00 
c9e9jsr $6966 
c99Ctda Sd9 
c9eeDra #560 
c9Fa sta Sd9 
c912 Ida #S27 
c9f4 sia Sd5 
cSre Idn #S01 
c9f8 six £0292 
c9fbdex 
c9lc stx Sd6 
c9te lar Ie9f0 
caOl jmp ScaSS 
ca04idx #S19 
ca06dex 
ca07bmi £cal4 
caD9lda Sd9.x 
caObbpl ScaOe 
caOdisr ScaeS 
cal0bcc3ca06 
cal2bcs £cald 
cai4ida #$tf 
calBsta S14 
caiasia 315 
caiapha 
calbbne5ca32 
caldcpx #118 
calf bno tca25 
ca2i Ida #SOd 
ca23 bne Sea 1a 
ca25cpx#$l7 
ca27 bne £ca2e 
ca29inx 
ca2alda Id9.x 
ca2cbpl Sca2l 
ca2elda #5M 
caSObnelcala 
ca32inc £14 
ca34 bne Sca3S 
ca36inc 115 
caSapr Sa6l3 
caSblda 
ca3d bmi 
ca3t ora 
ca4i sta 
Ga43 Idx 
ca45 [sr 
caieidx 

ca4a six 
ca4cjsr 
ca4f pla 
caSObm 
, ca52i3r 
caSSldy 
ca57lda 
ca59 beq ScaSO 
caBbsta Scb40 
caSe Ida 
ca60 sia 
ca62 sly 
ca64lda 
ca66sta 
ca6dlda 
ca6asla 
ca6c Ida 
ca6e sta 
ca70sta 
ca72|mpSa6d7 
ca75 cpx #£0b 
ca77beq5ca93 
ca79lda £cb40 
ca7cidy #SOi 
ca7esla (E3f).y 
caSOIda #SOd 
cae2rsr $rfd2 
caes f sr £caca 
caS6|Sf Scb2f 
caablda #$00 
ca6dsia £0292 



3da 

5ca4B 

#180 

Sda 

#S01 

Se9ft 

#£18 

Sd6 

SeStO 

I ScaSS 
Sfld2 

#£01 
(S5f).y 



#300 

£0" 

£51 

S3f 

S60 

$40 

VSlf 

£14 

S15 



.check value against 
.The link hi 
;to maich 

;make ($50 

, match 

,[$3r) 

Iplus 

.Ihey register 

.otfsei 

^ 

.ctieck bottom line 

.lor a link 

,not linked 

.erase second bottom 

:elim half linos 

,set to scrolJ down 

doit 

;fix the lop lines 

Jink 

; value 

-tix Its length also 

;fie[ insert mode 

.set cursor to 

llhehoma 

.posrtion 

.inlomair>lisl 
:set (0 scan 
.screen 
-Oonea^lir^G 
.gellink byte 
Jinked, relry 
.search f Of line* 
.r>ot preserkt 
.yes ship over 
.set lor first line 



;pus^ a byte 

Jump over code 

.was hne# on bottom 

.no 

,put byte onto stack 

r 

,was line# on 24th 
.iXj Skip over 

.vyias bottom lineked 

.yes, byte o^> stack 

,pulb/le onto Slack 

-increase I num by 1 



-find line number 
-second line (top) 
;linked*' 
-yes. unlick it 

; erase the 

;ine line 
:set cursof to 
.botlom 
.□I screen 
.pull a byte 
.negative skip over 
.punt the relurn 
.main li^t entry 
.checl( linkage 
;end 0^ lines 
:save link t>i\s 
,changa link to tool 
"the list routine 
;set list quote fig 
;Copy [£5f) 10 
;($30 



,seilinelistlop 

,lo a maximum value 

.into list routine 
.means error Irom 
.eva! txd pnl num 
;flx up 

the link thai was 
.cfianged earlier 
.print 
.a return 



;luf n oft insert mde 



ca93 pla 
ca94 pla 
ca95pla 
ca9Spla 
C397jmp£ca80 
ca9aux $c6 
ca9c imp ScaG5 
ca9f Idy #$00 
caal Ida $ct)45.y 
caa4 pha 
caa5iny 
caaecpy #106 
caaS bne Scaal 
caaalda #$00 
caacsta £<:b43 
caaf impSeafli 
cab2ldx £0287 
cabSlda £ce 
cab7|Si Seal 3 
cat-arts 
cabbida Sd6 
cabdsia ScMb 
cacOlda $d3 
cac2 sta £cb4c 
cacSida #100 
cac7sta Sd3 
cac9fls 

cacaidx $cb4b 
cacdsl* Sde 
cacl Ida £cb4c 
cad2sta £d3 
cad4 |Sr Se56c 
cad? Idy #$00 
cadOsty Scf 
cadbsly £02ec 
cade my 
cadt sty £cd 
CBe1 Sly S026b 
cae4r(s 
cae5 3sr $e9fO 
cae8lc(y #Stt 
caea my 

caeblda ($d1).y 
caed cpy #127 
cael beqScbl7 
call cmp#$20 
cat3 l:)eqScaBa 
caf5 cmp#£30 
cat? bccScbl? 
cat9 cmp#$3a 
caft) bcsScbl? 
cafd tya 
cate cLc 
caff adcSdl 
cbOl sta S7a 
cb03lda Sd2 
ct05adc#$00 
cb07Bia S?b 
cb09jsr $0079 
cbOcstx $cb44 
cbOf jsf £a96b 
cbl2ldx $cU4 
cb1 5 sec 
cbl6bit SIB 
cblSrls 
cbl9ldy «S01 
cblblda £0300.y 
cMesta Sctj41.y 
cb21 dey 
cb22bpl $cblb 
cb24lda #£75 
cb26sta £0300 
cb29lda #Sca 
cb2bsia S0301 
cb2e ris 
cb2f Ida Scb4i 

Cb32sla £0300 

cb35lda Scb42 

cb3Bsta S0301 

Cb3brl5 

cb3c 

cb3a 

cb3f 

cb40 

cb4l 

cb42 

Cb43 

Cb44 

cb45 

cb47 

Gb4S 

Cb49 

cb4t) 
cb4c 

cb4d 



ipull byte from 

;fxd pnl roulme 
.and horr\ find Ime 
.routine 
.into *ix up rtne 
.re- instate char 
.enter fix up rtne 
.mam exit rout 
;push all ihe 
.saved data 
.back onto 
.the stack 

h 

.set processing lo 
.null Slate 
.andejiil 
.erase cursor 
/ouUne 



■save cursor row 
.save cursor column 

h 

,set column lo 
:a zero value 

.restore cursor row 

.restore cursor ool 

;f IX cursor status 

.lix 

-up alllhe delay 

.counters so 
.Ifial scrolling 

-Will occur 
;much faster 

.set line 



.gel char from fine 

:at end of line 

.yes 

:a space? 

; under ascil 

.yes 

.over ascii '9 

,yes 

;lix (S7£4 to 

,match($dlj 

; plus the 

; index 

:int the y 

^regisler 

I 

chrgoi- set flags 
.savex'-reg 
:eva1 number 
.restore k vflf 
.carry sel - tound 
.enifytorcairydr 

!copv (10300) 
.sector torn erniory 

r 

;coniinue 
,sei new vector 



: restore Ihe old 
,(£0300) vector 



.data cursor up/dcwn 
; cursor down line 
,cursor up line 
-link byte save 
:slorage lor the 
,($0300) vector 
.processing status 
.x-reg temp storage 
.stack storage 
- tsix bytes ) 



.cursor row 
.cursor col value 
;up/down flag 



ca9Qjmp $ca9f .into exit routine 



I Th» ^onwicter 



S3 



Valunw 5/ Iuim 06 



STP: Execute From A Sequential File 

Chris Zamara, Technical Editor 



STP stands for "Sequential To Program", as this utility was 
originally written to convert a sequential program listing into a 
BASIC program. Thai enables you to LIST a program to disk, 
edit it with a word processor, then merge it with a program 
currently in memory. And if you felt like it, you could even 
write a program from scratch with a word processor, save it as a 
sequential file, then use STP to turn it into a normal program. 

As often happens with programs, STP turned out to be more 
useful tlian it was intended to be. STP turns a sequential file 
into a program by reading a disk file line by line (assuming 
carriage returns at the end of each line) and processing that line 
as if it were entered from the keyboard. So if the disk file 
happens to look like a BASIC program, then that program gets 
entered just as if you typed it in yourself. Consider, however, a 
file that looks like this: 

load"game,ml",8,1 

new 

load" game. bas\8 

10 rem 

list 

run 

This file could be created like this: 

openl,8,]2,"0:testfile,s.w" 



print*l,^load"chr$(34)^game.mr"chr$(34)'\8,l" 

print*!, "new" 

print*! , " load " chr$(34) ^ game.bas " chr$(34) " ,8 " 

print*l,-10rem" 

print*! /list" 

print*!, " run " 

close* 1 

STP-ing that file would give the same results as typing in those 
commands from the keyboard: you'd LOAD some machine 
language, NEW, load a BASIC program, REM out line 10, LIST, 
then RUN the newly loaded program. STP can automate some 
procedures that you currently don't have a program to do. You 
could use it to boot up some programming utility packages, 
change some parameters, set up some defaults, colour your 
screen and border nicely, etc. If you're familiar with the Power 



64 utility, you'll notice that STP does the same thing as 
Morepower's EXEC function. 

STP is only 1 73 bytes long, and as listed here, it lives at $C0OO 
or 49152 decimal. It may be convenient to assemble a version 
to he at 828 in the cassette buffer (such a version is on the 
Transactor disk for this issue). To use it, just call it with a SYS 
followed by a comma and the filename of the sequential file to 
be STPd. For example: 

sys 491 52, "test file 

Any string expression is valid, for example: 

10 input ■■ filename ";f$ 
20 sys 491 52,1$ 
30 end 

STP can be called from within a program, but will only become 
active AFTER the program ends. Pressing the STOP key will 
ha!t STP at the end of the line currently being read in. 

For the curious, STP works through the 64"s warm start link at 
$0302-0303. It routes this vector to the main routine, which 
reads in a line, prints it on the screen, puts a cursor-up and 
carriage return in the keyboard buffer, then jumps to the 
normal warm link entry point. The new line will be entered, 
and after It has been processed, control is again passed through 
the warm start vector and the process repeats until end-of-hle 
is reached. At that point, the link vector is restored to its normal 
state. 

The only other catch is the bit of trickery necessary to prevent 
the disk file from being closed after a BASIC line is entered or a 
NEW is performed. AH open files are normally closed by a 
routine that is fortunately vectored through an "abort 1/0 
vector" at $032C-032D. The vector points to $F32F, and the 
first thing that happens there is the accumulator is loaded with 
a zero to be stored in the number of open files variable at 
$0098, To keep one file open at all times, STP points the abort 
1/0 vector to its own routine which loads the accumulator with 
one, then sneaks by the LDA instruction in the abort 1/0 
rouhne. jumping to $F331 instead of $F32F. This effectively 
prevents the first file opened from ever closing. STP closes all 
open files before it opens the disk hie so that the disk file will be 
the fc^ open file. 



The Tranioctor 



54 



Volum* S, l«sua 06 



AN 
LI 
PF 
DH 
GK 
OH 

PB 

AF 

IN 

AF 

AD 

AM 

PB 

IG 

AF 

GH 

CJ 

MG 

CI 

LI 

PI 

JJ 

ON 

EM 

EM 

MA 

EM 

PM 

CA 

HP 

MB 

AD 

NB 

KL 

FE 

HJ 

DG 

OD 



HH 

KF 

NO 

MH 

CB 

KM 

NK 

EB 

OK 

HG 

EN 

NH 

FN 

HL 

AG 

EG 

MM 

NH 

FM 

IL 

GO 

IF 

PI 

EE 



The BASIC Loader Program 

10 rem" data loader for "stp" • 

20cs = 

30 tor i = 49152 to 49325:read a:poke i,a 

40cs = cs + a:ne>ft i 

50: 

60ftcs<>21681 thenprint"*-"* error in data 

statments *--*". end 
70 print " to run stp; sys491 52,filenarne " 

80 end 
100: 

lOOOdata 32.253,174, 32,158,173 
lOIOdata 32,143,173.169,100,160 
1020 data 101, 32,219.182,160, 
1030 data 177, 100, 72,200,177,100 
1040 data 72,200,177,100. 72,173 
1050 data 2, 3,141, 92.192,173 
1060data 3, 3.141. 93,192,169 
1070 data 94,141, 2. 3,169,192 
1080dala141. 3, 3.169, 87, 141 
1090data 44, 3,169,192,141, 45 
1100 data 3,169,127,162. 8,160 
mOdata 12, 32,186,255.104,168 
n20data104, 170. 104, 32,189,255 
1130data 32,192.255, 32.183,255 
1140data208. 28, 96.169, 1, 76 
1150data 49,243, 0, 0,162,127 
1160 data 32,198,255, 32.228.255 
1170data 32,210.255,201. 13,240 
1180data 38. 32,183,255,240,241 
1190datal69.127, 32.195,255,173 
1200 data 92,192,141, 2, 3,173 
1210 data 93, 192,141, 3, 3.169 
1220data 47,141, 44, 3.169,243 
1230data141, 45. 3, 32,204,255 
1240 data 108, 92,192.169, 2,133 
1250 data 198. 169, 145.141, 119, 2 
1260 data 169, 13,141,120. 2.165 
1270 data 197, 201, 63,240.203. 76 
1280 data 141, 192. 32,210,255.165 



The source code for STP 



00 sys700 

1010. opt 00 

1020 • - ScOOO 

1030; 

1040; 'STP" 

1 050 ;executes a sequential file 

1060 ;syntax is: 

1070 ;sys(addr). ' filename ' 

1080; 

1090 ;kernal entries: 



; pal 64 



llOOchikin 
mOctirout 
1 1 20 clall 
1130 close 
1 1 40 clrchn 
1150getin 
1160 open 
1 1 70 readst 
1 1 80 setlfs 
1 1 90 selnam 

1200; 
1210warmlnk 

1 220 abortio 

1230; 



$ffc6 
$ffd2 
$ffe7 
$ffc3 
$ffcc 
$ffe4 
$ffcO 
$ffb7 
$tfba 
$ffbd 

$0302 
$032c 



LE 
PK 
ON 
MG 
MH 
fvlP 
IN 
LI 
AF 
BA 
CL 
DO 
Dl 
IH 
KN 
HL 
00 
KP 
HL 
FH 
fVlE 
NJ 
Kl 
BO 
AM 
IE 
HN 
JA 
ML 
EB 
FM 
CI 
KP 
OA 
CK 
KG 
AK 
AfVl 
FJ 
EN 
MG 
HI 
MG 
FL 
NN 
EN 
EP 
EC 
NO 
AN 
BP 
AL 
NE 
JA 
LO 
FA 
JK 



KN 
FA 
01 
KN 
GL 
KC 
lA 
OD 



1 240 Istx 

1250 ndx 

1260 keyd 

1270; 

1280 ;gel filename 

isr 
jsr 
jsr 



$c5 
$c6 
$277 



last key pressed 
# of keys pressed 
keyboard buffer 



$aefd 

$ad9e 

$ad8f 



;check for comma 
;evalLiate expression 
;check for string 

lda#$64:ldy#$65 

jsr $b6db ;clean descriptor stack 



ldy#0:lda($64).y: pha ;length 
iny:lda ($64),y:pha ;addr low 
inylda ($64),y:pha ;addr fii 



jsr dall 



;close any previous files 



1290 

1300 

1310 

1320 

1330 

1340; 

1350 

1360 

1370 

1380; 

1390 

1400; 

1410 ;chiange warm start link 

1420 ;and abort i/o vector 

1430 Idawarmink .staoldwarm 

1440 ldawarmlnk+1: staoldwarm + 1 

1 450 Ida #<newarm ; sta warmlnk 

1460 lda#>newarm : sta warmlnk + 1 

1470 lda#<newio : sta abortio 

1 480 Ida ^>newio : sta abortio + 1 

1490; 

1500 ;open disk fife 

1510 

1520 

1530 

1540 

1550 

1560 

1570 

1580; 

1 590 newio 

1600 

1610; 

1620Dldwarm .worO 

1630; 

1640 newarm = * 

1650 ;new warm start link points here 

1660 ldx#127: jsrchkin 

1670nexbyt = 

jsr geti n: jsr ch rout 
cmp#13: beq endlin 
jsr readst beq nexbyt 



lda#127:ldx#8:ldy#12 

jsr setlfs ;open 127,8,12 

pla;tay:pla:lax:pla 

jsr selnam 

jsr open 

jsr readst: bne outO ;disk error 

rts 



=; * 



;keep 1 file open 



Ida#1:jmp$f331 



1680 

1690 

1700 

1710; 

1 720 oulO 

1730 

1740 

1750 

1760 

1770 

1780 out 

1790 

1600 

1810; 

1820 endlin 

1830 

1840 

1850 

1860 

1870 

1880 

1890 .end 



lda#127;]sr close 
Idaoldwarm : sta warmlnk 
ldaotdwarm + 1: sta warmlnk + 1 
Ida #$2f: sta abortio 
lda#$f3:staabortto+l 



;? • 



jsr clrchn 
jmp (oldwarm) 



Ida #2: sta ndx ;# keys in buffer 
lda#145: sta keyd ;crsr up. . . 
Ida#13: sta keyd + 1 ;&cr inkbuf 
Ida Istx ;key pressed 

cmp #63: beq outO icheck for stop 
jmp out 



55 



\^>luiw 5, iMue 06^ 



Quote 
Killer 




Gary Gunderson 
Richmond, BC. 



Quote killer was born on a bright sunny day as I lounged by the pool 
sipping a tali cool drink. Serendipity you say? You would be absolutely 
correct if you ihink serendipity has some relationship to a threat to 
your computer's well being. 

My girlfriend had expressed interest in learning how to program my 
C64 (neal girlfriend, eh!, and no, she is not available). To that end, I 
had bought her a book for neophyte programmers into which she had 
plunged with enthusiasm. But alas, there she stood trembling with 
indignation and threatening to teach my machine how to do the swan 
dive. 

All she could say was, "Dumb stupid quote mode!*' 

Thinking quickly while I gingerly plied my 64 from her hands, i 
promised her I would do something about it- 
It is generally accepted That Commodore's on-screen editor is one of 
the best in the industry. The only major fault it has is the inability of 
the programmer to lake the machine out of quote mode {or insert 
mode) without pressing the return key; the 64 lacks the handy ESC 
key of the 8032 machines. Consequently, you have to hit return and 
cursor back to the mistake to correct it. This doesn't present much of a 
problem, other than the inconvenience, to those of us who are used to 
it but for the novice, it is often a source of ongoing frustration. 

The most obvious choice tor a key to toggle quote killer was one of the 
function keys, and indeed Fi was the key I originally used. I immedi- 
ately ran into problems with this when f started to design a program 
that made extensive use of the functon keys. At that lime I realized 
that Commodore, in all its mystery and imagination, had included an 
apparently useless key on the keyboard. Tell me, when was the last 
time you used the back-arrow key for anything? 

During this change of keys I decided to add a few features to quote 
killer which would make it much more useful to the advanced 
programmer. Quote killer now has the ability to force the machine 
into quote mode and to force a single character insert mode without 
opening any space in text. As an afterthought I also included the 
ability to force the repeat of any character on the keyboard when that 
particular key is held down. All the keystrokes that you need to know 
for the activation of quote killers modes are included in the BASIC 
loader and wili l>e displayed when the program is run. 



Quote killer resides at the top of the cassette buffer and is therefore 
sensitive to any form of reset or tape operation. The only safe way to 
disconnect it is with RUN-STOP/ RESTORF.. SYS903 will reconnect it. 

If for some reason you don't like my choice of the toggle key, you can 
alterit by changing the first data element of line 1050 to the keyboard 
matrix number of your choice. For example, a 4 in this location will 
make Fl the toggle. Remember, changing the BASIC loader in this 
way will change the checksum value, so change the checksum 
comparison accordingly or get rid of it altogether. 

For those of you who are curious, quote killer demonstrates how to go 
about changing system vectors to suit your own needs. It is a very 
simple but powerful technique- The machine code is less than 100 
bytes and should be very easy to follow. 

By the way, having a girlfriend that likes to program is not always the 
most ideal situation. What do you do when she takes a piece of your 
immaculate code, shortens it by one third and makes it run 25 percent 
faster? Say ''thank you"? 



JH 
HC 
GC 
EH 
NH 
FN 
DP 
LD 

OB 
ED 
DF 
KB 

10 

Fl 
AB 

LK 

KC 

PI 

PG 

OB 

LO 

BC 

KB 

ND 

JE 

FF 

GC 

CA 

JG 

KG 

GG 

BA 

NN 

NK 



1 rem "">«»»««*««««i».w**»**»** 

2 rem •"* quote killer '-* 

3 rem *** by *♦* 

4 rem ^'-^ gsry gunderson ■^** 

10fori=903to99S:reada:cs = cs + a:poke i,a 

20 next i 

30 if CS011 893 then print"** error in data 

statements!! ••"lend 
40 sys903;printchr$(-!47) " quote killer activated. 
50 print " -*- - kills quote mode 
60 print ' - kills insert mode 
70 print " - kills repeat mode " :print 
80 print" 

90 print " shifted ^ -enables quote mode 
1 00 print " commodore •- -one char ins mode 
1 20 print " Ctrl — -enable repeat for all 
130 print" keysVprint 

150 print" run-stop/restore to deactivate 
1 60 print " sys903 to reactivate " 

170: 

1000 data 173, 144, 2,201, 3,240, 86 
1010data173, 143, 2, 141,248, 3, 173 
1020 data 144, 2. 141,249, 3, 120, 169 
1030data167, 141, 143, 2, 169, 3, 141 
1040 data 144, 2, 88, 96,165,203,201 
lOSOdata 57,208, 55,173,141, 2,201 
1060 data 1,240, 22,201, 2,240, 25 
1070data201, 4,240, 28,169, 0,133 
1080data212. 133,216, 133, 199. 141J38 
1090data 2. 76,224, 3,169, 1,133 
1100data212, 76,224, 3,169, 1,133 
1110data216, 76,224, 3,169,128,141 
1120data138, 2,234,234,234,169. 64 
1130 data 133, 203, 108,248, 3 



": print 



The Traniactor 



56 



Vbluma 3, Usuft 06 



Gap Remover 

Richard Evers, Editor 




-f' /'^V^tt/ 



Let's set the scenario. You liave just SAVEd a file to diskette and, to set 
your mind at ease, perforined a directory of the diskette. You view the 
entire directory only to discover that your file isn't there. You fall into 
great despair, . . a feeling that ait your work has been in vain. With a 
sudden blast of inspiration, you look through the directory once 
again, very carefully this time. Within seconds your pulse is back to 
normal, but all is not right. Your file has mysteriously placed itself 
smack in the middle of the directory listing, thus falling into a prior 
scratched file's Black Hole\ 

The situation is common, but often not as dramatic. If you have used 
your drive for longer than a few days, you already have accepted this 
rotten fact of life. Scratched files leave holes that future files trip into. 
This leads to disorganized directories, and strange delays when 
performing a passive catalog. A problem that now has a cure. Enter 
The Gap Remover'. Fire it up, answer a few important questions, and 
within a few minutes your directory will be clean and fresh, all extra 
spaces removed and placed at the very bottom. From then on, every 
file you SAVE will appear last in the directory. 

Without burning up precious magazine space, the concept is as 
follows. The directory on your diskette is held on one track, track 18 
for the 1541/2031/4040 drives, and track 39 for the 8050/8250 
monsters. The first directory block is sector *1, with eight file entries 
per sector maximum. The first two bytes of every sector holds the 
track and sector of the next directory block. The sectors are spaced 3 
apart, to allow for the drive to naturally reach it as it spins around. If 
the directory sector being read is the last one used, the track will read 
as a zero, and the sector will be $FR The DOS realizes that there is no 
track zero, therefore the end has come. Simple so far. 

The program reads in every entry from the directory track, keeping 
the link pointers in check as it goes along. If a non-existent file 
appears, one in which has been scratched, the file is flagged to the 
screen as showing as a gap, and its space is ignored. Every valid 
directory entry is kept in an array. When the entire directory has been 
read through, the packing process begins. The non-existent files have 
already been removed, therefore it is just a simple process of writing 
the packed entries back in. Once the process determines that the end 
of valid entries has occurred, null entries (32 x $00' s) are written to the 
directory sector involved to fill in the extra space. When complete, 
you may end up having an extra directory sector or two if the packing 
required was large, but the directory will be OK. You can now SAVE 
files to your heart's content and never have to worry about them 
falling into the mysterious Black Holes of the DIR quadrant. 



MD 
AD 
HD 
CK 
BE 

GB 

NL 
EB 

DP 
DM 
OF 
JK 
IJ 

AF 
IH 

EK 
OG 
AK 
CD 
BE 
CJ 

FE 

GE 
BF 
GF 
IM 
FE 
IM 
GO 
CC 
II 

KH 
LH 
GH 
JO 

DM 
JE 

PK 
LE 



1 rem save " 0:gap fill.bas " ,8 

100 rem rte/84 - gap filler for spaces left in your directory 

110 print"** directory gap filler - rte/84 **" 

120 print'drive type:' 

130 input" 1)1541/2031/4040 or 2) 8050/8250 ";dt:ifdt<l 

ordt>2 then 130 
1 40 mtrk = 1 8: if dt = 2 then mtrk = 39: rem assign correct 

directory track 
150 input" drive ^ ";dr; if dr>l then 150 

160: 

170 dim dirS(223): rem ** max directory entries 

180 dim tl$(27), sl$(27): rem •* track/sector links 

1 90 trk = mtrk: sec = 1 : rem directory track and first sector to use 

200ctr=0:lnk = 0:zS = chr$(0) 

210rp$= ^Morx = 0to29:rp$ = rp$ + chrS(0):next; rem 

** replacement string 

220: 

230 open 15,8,15: open 5,8,5/*": rem command channel 

+ buffer 
240print*15, "ul: " ;5;dr;trk;sec: rem read dir entry into buffer 

250: 

260forx = 0to255step32 

270 gel*5.t$,sS: if x then 290: rem get correct links 

280 trk = asc{t$ + zS): sec - asc(s$ + z$): rem link t/s 

290fory = 2lo31;get*5,a$:dir$(ctr}=dir$(clr)+chr$(asc(a$ + z$}} 

: next y 

300 a$ = midS{dir$(ctr),4,l6): if asc{dir${ctr)) then 320: rem if 

not scratched 
310 print a$tab(17)'« gap »':dir$(ctr)='"; goto 330 

320 print a$:ctr=ctr+l 

330 next x 

340: 

350 tl$(lnk)=chr$(trk): sl$Onk)=chr$(sec) 

360 if trk then Ink = Ink + 1 ; goto 240: rem ok - go for more 

370; 

380 rem " directory completely loaded In - now time lo pack 

390trk = mtrk:sec=l;fin^0 

400forx = 0tolnk:print*15/b-p:"'5;0 

410ts$ = tl$(x) + sl$(x):dd$= " " : rem link t/s 

420 for y = to 7: aS = dir$(fin): if fin = >ctr then aS = rpS 

430 dd$ = ddS + aS; if y<7 then dd$ = dd$ + chr${0)+ chr$(0) 

: rem wasted 2 bytes/ entry 
440fin = fin + l; next y 
450 print*5,ts$;dd$:: print*15, ' u2: " ;5;dr;trk;5eCi: rem fill 

buffer then write 
460 lrk = asc(tl$(x)): sec = asc(sIS{x)) 
470 next x; close5: closelS: end 



*« 



The Transactor 



57 



Volume 5, Itiue 06 



Machine Language 
Print Loader 



Noel Nyman 
Portland, Oregon 



PRINT. . .NOT POKE. . .Machine Language Programs 



Editor's note: The BASIC loader program accomportying this article is 
quite long, but the article contains concepts which can be digested 
independently of the program. Ifyouwanla copy of the accompany- 
ing program but don't feel like typing it in, you can find it on the 
Transactor disk for this issue. 

BASIC programs often use machine language lo read disks, sort data, 
or accomplish something more quickly and easily than can be done 
with BASIC alone. The common ways to use ML with BASIC are: 
LOAD the ML from disk or tape from the BASIC program, append the 
ML to BASIC, or use READ/ DATA/ POKE statements. 

Each of these has its place. But in this arhcle we'll explore another 
method. . .using BASIC PRINT statements to "poke" ML programs. 



line the cursor is on. The vector is stored in usual 6502 format, low 
byte first. 

location 21 1 identifies cursor location on the line by column riumber. 
location 213 tells the system how long alineis. The usual values for 
213are39or79foraC-64,and21,43, 65, or87foraVIC. 

These numbers need to be in the proper ranges, or your screen will 
look strange. But when we use PRINT to store ML, we can change 
them to our advantage- In line ''1 above, we re-vectored the cursor 
lostarlatcolumnzeroona"line"beginningat address 7000. We then 
told the computer that this line is forty columns long. We could have 
used any number up to 255 for line length, so long as it was greater 
than the number of bytes we wanted to store. 



First, type in the following line exactly as shown. If a letter is 
capitalized, hold the SHIFT key when typing it. For commands such 
as (com-m) hold the Commodore key and type'm." Press the SPACE 
bar when you see (SPACE), 

20 ? " (rvs-onKSPACEXrvs-off)@(rvs-on)9(rvs-off) 

(com-m) [ (rvs-onXcom-a)(rvs-ofOg(SPACEXrvs-on)R(com"b} 
Hfrvs-ofOLZ [ (ShHSPACE)Krvs-on)s(rvs-olf)THIS(SPACE) 
IS(SPACE)THE(SPACE)ML(SPACE)DATA@ " 

Now type RUN, You should see thirty-seven characters printed to the 
screen. Shifting to lower case mode may help you count them. 

Next type this additional line: 

10POKE209,88:POKE210,27:POKE211,0;POKE213,40 

Type RUN again. This time you should see only the READY prompt. 
Type SYS 7000, the screen will clear and the ML message will be 
displayed. 

We normally think of the PRINT command as "printing^' characters on 
the screen starting from the current cursor location. Of course, we 
know that PRINT just stores a sequence of data into computer 
memory. The VIC chip reads that data and creates the screen we see. 

This may seem like a trivial distinction at first. But we can use the 
sequential storing characteristic of PRINT to "poke" ML programs and 
data. All we h3ve lo do is move the "cursor" away from screen 
memory to the area where we want the ML to reside, then put the ML 
data into PRINT statements. 

The cursor position is controlled by several memory locations. We'll 
be concerned with four of them. Locations 209 and 210 together form 
the cursor current line "vector", the address of the beginning of the 



After you typed RUN, you saw the READY prompt. This shows you 
that the cursor will be vectored back to the normal screen memory by 
thcopcratingsyslemattheendofeachPRlNTstatement, Actually, we 
could use several PRINT statements ending with V and the data will 
be stored continuously, just as it would be shown continuously on the 
screen. If we want to store over 255 bytes of ML, we'll need another 
POKE line with new values at locations 209 and 210. 

PRINT puts "screen codes" in computer memory, not CHRS values. 
The USER'S GUIDE that came with your machine has a table of screen 
codes in an appendix. If you compare them with the CHR$ codes, 
you'll notice that there are only 128 screen codes. Also they are often 
in the same sequence as the CHR$ codes, but start at different places. 
For example, the alphabet is in order. However, CHR$(65) which is 
the letter 'A' has a screen code of 1. Therefore, to get a 1 stored in 
memory we PRINT an W. To store a 65, we have to PRINT a 'spade' 
symbol- 

Another problem shows up if we need to store 34', This is the screen 
code for quote marks. If the PRINT command sees quote marks. It will 
end string printing and try to cope with the balance of the characters 
on the line as variables. A special technique is required to PRINT a 
"34" into memory. 

Since it's so much work to create the PRINT statements, are there any 
advantages over the other methods? There are, especially if you use a 
program to create the PRINT statements. 

Of the methods mentioned at the start of this article, READ/DATA/ 
POKE is the most common. For short ML it saves time over LOADing 
the ML routine separately. It also avoids having to store the ML as a 
separate program on the same disk or tape. It has two disadvantages, 
however. It's slow and it takes a big chunk of memory. Memory saving 
is most important to VIC owners. But anyone could take advantage of 
improved speed. 



Ths^xinMictor 



58 



Volume 5, Isiue 06 



Storing MLat the end of a BASIC program is becoming more common. 
It requires a few POKEs to convince the system to SAVE the ML along 
with BASIC, and even more cleverness if the BASIC program is 
chanf^ed. It also reduces available variable memory to VIC owners, 
since ttie ML sits in BASIC memory area. 

By using PRINT statements to store your ML programs, you can save 
BASIC memory and improve program run time over the READ/ 
DATA/POKE method, PRINT works eight to thirteen times faster than 
READ/POKE. The exact memoty saving depends on the ML program. 
But it usually takes less than half the BASIC memory to store ML in 
PRINT statements over DATA statements. 

The PRINT lines are a part of BASIC, not an ML appendage. So any 
editing done to the BASIC program will not affect them. 

Program O perdition 

To make using this technique easier, weVe provided ML ''PRINTER*' 
programs for the VIC and the C-64 that will create the PRINT and 
POKE statements in BASIC. Well look at the C-64 program first. 
Listing -I is a READ/ DATA/ POKE program to pu! ML "PRINTER" 
into C-64 memory. Type in the program, SAVE it, then RUN it. Then 
type SYS 25856. 

The screen will prompt you for the beginning and ending locations of 
the ML you want to "copy", the number of the first BASIC Une to be 
created, and the increment for the following BASIC lines, You'll be 
given the option of entering the ML locations in hex or decimal. Type 
in any locations to test the program. 828 and I0l9{lhe cassette buffer) 

for example. After the READY prompt, type LIST You41 see the newly 
created BASIC, which has been written over the READ/ DATA /POKE 
program. 

You could SAVE these lines to be appended to a BASIC program or 
continue entering a BASIC program using them. 

To use ML ^TRINTER" most effectively, you should have it as a ML 
program. (You can use it to make a BASIC PRI NT version of itself , but 
an ML version is shorter and for a program this size, more efficient.) If 
you have a monitor, you can use it to save the program. If not, type the 
following exactly as shown: 

CLR (RETURN) 

POKE43,0:POKE44,101 POKE45,185 :POKE46, 108 (RETURN) 

This moves the start and end of BASIC to enclose ML "PRINTER.^' 
Now SAVE the program to tape or disk just as you would any BASIC 
program. After the SAVE is complete use SYS 64738 to reset the 
computer. You can now LOAD ML "PRINTER'^ using a \V after the 
LOAD statement. 

This program will work best for you if you use it on relatively short ML 
routines. If you go above about L5K bytes, it's faster to LOAD ML 
routines from disk. For example, using ML "PRINTER" to store DOS 
5,1 as a BASIC "PRINT' program requires loading only one program. 
But it takes about three seconds longer to PRINT than it does to RUN 
the boot program which LOADs the normal ML version from the disk. 

If you use ML "PRINTER" to PRINT over IK of ML, 1025 bytes or 
more, you'll find that BASIC will work fine. But your keyboard won't. 
Apparently when the screen gets longer than 1024 bytes, the operat- 
ing system is confused and the CIA chips get "iost;^ If you SYS to the 
ML immediately after printing you should have no problems. If not, 



follow the last PRINT statement with a BASIC line that contains: 



SYS 64931 PRINT '{shift/clr-home 



This will put everything right again. The "clear- screen*" command is a 
good idea in any case to restore the normal line length parameters. 
Since you usually need to get the ML in place early in the BASIC 
program, you could put the PRINT statements (or a GOSUB to them) 
ahead of a "clear-screen" already in the program. 

The C-64 program has been located in an area unlikely to have ML 
residing in it. The program may give strange results if the interrupt 
system has been changed by a previous program, such as the DOS 
wedge. It's best to use a full RESTORE, such as SYS 64738, before 
loading and using ML "PRINTER" You may need to use the NEW 
command after loading ML "PRINTER" to load the ML you want to 
"copy,'' 

The VIC version was written for the unexpanded VIC-20, primarily to 
"copy" ML in the cassette buffer. Expanded VIC owners will want to 
use a variation on the C-64 program, to be discussed laten 

There are two READ/DATA/ POKE programs for the VIC, because 
there isn't enough room in VIC memory to hold all the DATA. A PRINT 
statement version will fit in VIC memory easily, however, which 
shows how much more compact it is. 

Type and SAVE each program. To save on memory, we ve left the 
screen prompts out of VIC ML "PRINTER;' Program '4, VIC SCREEN, 
is a BASIC program that will get the various numbers the "PRINTER" 
needs. Type in and SAVE this program also. 

LOAD and RUN each of the VIC DATA programs in sequence. This 
will POKE the ML portion of the ''PRINTER" in place. Then type the 
following directly to the screen: 

POKE55,0 .POKE56,25 (RETURN) 
NEW;CLR (RETURN) 

This will move the end of BASIC memory below ML "PRINTER" to 
protect it. Now LOAD the VIC SCREEN program and RUN IL h will ask 
for the same information as the C-64 version, except thai the ML 
locations must be entered in decimal (base 10). To SAVE VIC ML 
'PRINTER" we'll use it to make a PRINT statement version of itself. 

Type 6927 and 7678 to answer the prompts for starting and ending ML 
locations. Use ten as a starting line for BASIC, and one as the 
increment. 

When you see the READY prompt, type SYS 6927 and hit RETURN. 

Then type LIST VIC SCREEN has been replaced with POKE and 
PRINT statements that will create ML "PRINTER." To make this 
version complete, you'll want to append VIC SCREEN to it. To do this, 
you move the start of BASIC to the end of the present BASIC program 
by typing the following directly: 

CLR (RETURN) 
POKE43.PEEK(45)'2:POKE46,PEEK(44) (RETURN) 

Now LOAD VIC SCREEN. When READY appears, reset the BASIC 
pointers by typing: 

POKE43, 1 :POKE44,l 6 (RETURN) 



Th« IWinMCtor 



99 



Volume 5, Imu* 06 



UST and you'll see VIC SCREEN added onto the POKE/PRINT lines. 
Then add the following line: 

1150 SYS 6927 (RETURN) 

SAVE this completed version of VIC ML 'TRINTER/' 

Both versions of ML 'PRINTER'' update the BASIC start and end 
parameters after the new BASIC lines are created. Since the BASIC 
memory location is different for different Commodore computers, the 
VIC and C-64 versions use different values. Expanded VlCs have 
BASIC relocated, so the VIC ML "PRINTER'' won't work with them. If 
you have an expanded VIC that has memory in the range 25856 to 
27500, you can use the C-64 "PRINTER" with a few changes. These 
can be made easily with any VIC monitor programs such as VICMON. 

The data from $6500 to $6508 are C-64 border and screen color 
commands. Change them to $EA for NOP. Change the starting 
address information in locations $666B and $6667 to correspond to 
your beginning BASIC memory area, PEEK(43) and PEEK(44). Sub- 
tract one from PEEK(43) and put the result in $6671 . Change $$6672 
to the PEEK(44) value. Change the data at $676C and $6776 to 
correspond to your normal top of BASIC, PEEK(55) and PEEK(56). 
The program should then function correctly, although the screen will 
still be in C-64 format. 

To append the POKE/PRINT statements to another BASIC program, 
you can use the following technique with the C-64 or any VIC, LOAD 
the program with the lowest line numbers. The lowest line number in 
the program to be appended must be higher than the highest line 
number of the first program. ML 'TRINTER" gives you the option of 
selecting line numbers to make this easy. Type: 

PRINT PEEK(43)PEEK(44) (press RETURN) 

Write down the two numbers that appear on the screen as "x" and yj' 
This is the start of BASIC memory in your computer- Type: 

PRINT PEE K(45) (RETURN) 

This is the lower byte of the address of the end of the BASIC program 
you just LOADed. If this number is not zero or one, type: 

POKE43PEEK{45)-2;POKE44,PEEK(46) (RETURN) 

If PEEK(45) gave you zero or one. type: 

POKE43,PEEK(45) + 254:POKE44,PEEK(46)-1 (RETURN) 

These statements move the start of BASIC memory to the end of the 
program. Now LOAD the second program as a BASIC program. Then 
type; 

POKE43,x:POKE44,y (RETURN) 

Where 'Y' and "y" are the two numbers your wrote down earlier This 
moves the start of BASIC back to the beginning of the first program. 
LIST will now show the second program appended to the firsL 

I'd like to thank Barbara Horton for her help in developing the VIC 
version of this program. 



PL 
LI 
OF 
DM 
GK 
DC 

U 

AF 

IN 

LG 

OD 

FA 

ED 

FD 

AK 

Dl 

Fl 

CH 

OL 

HI 

ID 

IG 

01 

EN 

LK 

DL 

LA 

CD 

CM 

LN 

AP 

DP 

LA 

GF 

AD 

10 

PE 

ID 

PD 

AD 

MM 

BF 

GG 

GH 

LH 

M! 

EG 

DL 

LO 

MP 

MC 

HD 

CE 

OP 

HO 

PO 

MO 

KB 

NA 

JB 

BP 

PD 

EF 

NH 



Usting 1 : BASIC loader for €64 version 

10 rem* data loader for "print ml" • 

20cs^0 

30 for i = 25856 to 27832:read a:poke i,a 

40cs = cs + a;next j 

50: 

60 if CSO203777 thenprint ■"*#»• error in data 

statments •••--; end 
70 rem sys 25856 
80 end 
100: 

1000 data 160, 6, 140, 32, 208, 200 
1010 data 140, 33,208,169,213,133 
1020 data 139, 169, 106, 133, 140. 32 
1030 data 137, 103, 169, 106. 133,140 
1040dalal69, 96,133,139,169, 1 
1050data141, 167, 2. 32,151,103 
1060data173, 192, 2, 56,233, 72 
1070data240, 8, 169, 1, 141,254 
lOeOdata 2, 76, 55,101,141,254 
1090data 2, 32, 6,1^4,169, 85 
1100data133, 139, 169, 107, 133, 140 
inOdata 32,137,103,173.254, 2 
1120data 24,105. 4,141,167, 2 
1130data201, 5,240, 7,169,114 
1140 data 133, 139, 76, 93,101,169 
1150 data 101, 133,139, 169, 108, 133 
1160dala140, 32,151,103,173.254 
11 70 data 2,201, 1,208, 6, 32 
naOdata 24,104, 76,116,101, 32 
11 90 data 11 4, 104, 173,171, 2,141 
1200 data 252, 2,173,172, 2,141 
1210data253, 2, 32, 6,104,169 
1220 data 110, 133, 139, 169, 107,133 
1230 data 140, 32,137,103,173,254 
1240data 2,208, 22,169,114,133 
1250 data 139, 169. 108, 133, 140, 169 
1260data 4,141,167, 2, 32,151 
1270 data 103, 32,114.104. 76,188 
1280 data 101, 169, 101, 133, 139, 169 
1290 data 108, 133, 140, 169, 5, 141 
1300 data 167, 2, 32,151,103, 32 
1310data 24,104.173,171, 2.141 
1320 data 250, 2,173,172, 2. 141 
1330data251, 2, 32, 6,104.169 
1340 data 133, 133, 139,169,107,133 
1350data140, 32,137,103,169,101 
1360data133, 139, 169, 108, 133, 140 
1370 data 169, 5, 141, 167, 2, 32 
1380data151,103, 173, 192, 2,208 
1390data 39,169, 49,141,192, 2 
1400 data 32,210,255,169, 48, 32 
1410data210,255,141,193, 2, 32 
1420dala210,255, 141, 194, 2, 32 
1430dala210, 255, 141, 195, 2, 32 
1440 data 210, 255, 141, 196, 2, 169 
1450 data 5,141,168, 2, 32, 24 
1460 data 104, 173,171, 2. 141,248 
1470 data 2, 173,172, 2, 141,249 
1480data 2, 32, 6,104,169,196 
1490 data 133, 139, 169, 107,133,140 
1500data 32,137,103,169,101,133 
1510 data 139, 169, 108, 133, 140, 32 
1520data151,103,173, 192, 2,208 
1530data 21,169, 49,141,192, 2 
1540data 32,210,255,169, 48,141 



Th# Transactor 



60 



Volume S, l>su« 06 



LK 
ME 
HF 
IF 
DB 
OF 
EH 
FH 
Nl 
FJ 
MJ 
BL 
ML 
HK 
KO 
HO 
10 
CA 
HN 
FD 
OP 
MF 
NO 
JC 
AE 
PP 
OG 
BL 
GH 
OK 
El 
C) 
PP 
CH 

GJ 
FJ 
CL 
PI 
PM 
AL 
NP 
MD 
ON 
DN 
JB 
LM 
KJ 
KD 
HE 
NK 
LG 
GB 
Jl 
PN 
OF 
JA 
CH 
MF 
LA 
GL 
NJ 
LJ 
PO 
EO 
JF 
GN 



1 790 data 
1 800 data 



1550 data 193, 2, 32,210,255,169 
ISeOdata 2,141,168, 2, 32, 24 
1570data104, 173, 171, 2,141,246 
1580data 2,173,172, 2,141,247 
1590data 2, 32, 6, 104, 169, 8 
1600 data 133, 114, 169, 1, 133, 113 
1610 data 169, 0,141, 0, 8,141 
1620data244, 2,141,245, 2.141 
1630data237, 2,141,236, 2,173 
1 640 data 253, 2, 1 33, 248, 1 73, 252 
1650 data 2, 133, 247, 173, 249, 2 
1660 data 141 , 243, 2, 173, 248, 2 
1670 data 141, 242, 2,169,107,133 
1680 data 140, 169,241, 133, 139, 32 
1690data137, 103, 32,174,105, 32 
1700 data 239, 105, 32, 62,106,169 
1710 data 0,141,237, 2,168,177 
1720 data 247, 133,254,201,128, 176 
1730 data 21,173,245, 2,201, 1 
1740 data 208, 32,169,146, 32,232 
1 750 data 1 04, 206, 245, 2, 238, 244 
1760 data 2, 76,222,102,173,245 
1770data 2,201, 1,240, 11,169 
1780 data 18, 32,232,104,238,245 

2,238,244, 2,165,254 
10, 74,201, 34,208, 6 
1810 data 76, 79,106, 76, 24,103 
1820 data 133, 254, 10, 10,176, 16 
1830 data 10,144, 5,165,254, 76 
1840 data 18,103,165,254, 24,105 
1850data 64, 76, 18,103, 10, 144 
1860 data 8,165,254, 24,105. 64 
1870 data 76, 18,103,165,254, 24 
1880 data 105, 128, 32,232,104,238 
1890 data 244, 2,238,236, 2,230 
1900 data 247, 208, 2, 230, 248, 1 73 
1910 data 250, 2, 197, 247, 173, 251 
1920 data 2,229,248,176, 6, 32 
1930 data 143, 106, 76, 91,103,173 
1940 data 236, 2, 201 , 255, 208, 6 
1950 data 32,172,106, 76,149,102 
1960 data 173, 244, 2,201, 57,144 
1970 data 11, 32,194,106, 32, 62 
1980 data 106, 169, 0,141,244, 2 
1990 data 76,169,102,230,113,208 
2000data 2,230, 114, 165, 113, 133 
2010 data 45,133, 47,133, 49,165 
2020data114, 133, 
2030 data 50,169, 
2040 data 53, 133, 
2050 data 128, 133, 
2060 data 1,133, 
2070data 44,169,147, 32,210,255 
2080 data 96,160, 0,177,139,240 
2090 data 7, 32.210.255,200, 76 
2100 data 139, 103, 96,169, 0,141 
2110 data 168, 2. 169, 192, 133, 141 
2120 data 169, 2,133,142,160, 
2130datal77, 139,141, 169, 2, 32 
2140 data 159, 255, 32,228,255,172 
2150 data 169, 2,209,139,240, 6 
2160 data 136, 240, 233, 76,180,103 
21 70 data 201, 20,240, 54,201, 13 
2180data208, 15,168,165,197,201 
2190 data 64,208,250,162, 0,202 
2200datal38,208, 252, 152, 96,172 



46, 133, 
0, 133, 
54, 133. 
56,133, 
43, 169, 



48, 133 
51,133 
55, 169 
52, 169 
8.133 



EN 
BO 
IP 
OF 
GA 
BE 
BA 
PC 
HL 
BG 
DH 
IF 
JD 
GG 
OF 
CO 
EF 
HE 
DJ 
PJ 
CI 
PJ 
HH 
AK 
JM 
JC 
NF 
JP 
PP 
HA 
IE 
GO 
NE 
MB 
KC 
BF 
JE 
KD 
ID 
HG 
CO 
NH 
NE 
FP 
OA 
HC 
Kl 
KP 
PL 
00 



2210 data 168, 2,170,173,167, 2 
2220 data 205, 168, 2, 240, 195, 138 
2230 data 32,210,255,145,141,238 
2240 data 168, 2,165,197,201, 64 
2250 data 240, 250, 1 60, 0, 1 36, 208 
2260data253, 76,164,103,172,168 
2270 data 2,240, 167,206, 168, 2 
2280data 32,210,255, 76,234,103 
2290 data 160, 15,169, 2,133,142 
2300data169, 192, 133, 141, 169, 
2310datal45, 141, 136, 16,251, 96 
2320 data 173, 168, 2,170,169, 
2330 data 141, 170, 2.141,171, 2 
2340 data 141, 172. 2, 169,192, 133 
2350 data 141. 169, 2,133,142,172 



LL 
CM 
IH 
JH 
OE 
NE 
KC 
Al 
NE 
AE 
JC 
DP 
GG 
AK 
GO 



2360 data 170, 
2370 data 171, 
2380 data 171, 
2390 data 171. 
2400 data 171, 



2,177,141, 72, 14 
2, 46,172, 2,173 
2,172,172, 2, 14 
2. 46,172, 2, 14 
2. 46,172, 2, 24 
2410data109,171, 2.141,171, 2 
2420 data 152, 109, 172, 2, 141, 172 
2430 data 2,104, 56,233, 48, 24 
2440datal09, 171, 2,141,171. 2 
2450 data 144, 3,238,172, 2,238 
2460 data 170, 2.202,208,190, 96 
2470 data 173, 195, 2,208. 26,173 
2480data194, 2,141,195, 2,173 
2490datal93, 2,141,194, 2,173 
2500 data 192, 2,141,193, 2,169 
2510data 48,141,192, 2, 76,114 
2520 data 104, 169, 0,141,170, 2 
2530 data 169, 192, 133,141, 169, 2 
2540datal33, 142, 160, 0,177, 141 
2550data141,174, 2,238,170, 2 
2560 data 172, 170, 2,177,141,168 
2570 data 173, 174. 2, 72,152, 32 
2580data222, 104. 141,173, 2,104 
2590data 32,222,104, 10, 10, 10 
2600 data 10, 13, 173, 
2610 data 170, 2,201, 
2620 data 152, 141, 172, 
2630 data 2, 172,170, 
2640data104, 152, 141,171, 2, 96 
2650 data 56,233, 48,201, 16.144 
2660 data 2,233, 7, 96,162, 
2670data129, 113. 230, 113, 208, 2 
2680 data 230, 114, 96,169, 48,141 
2690 data 165, 108, 141,166, 108,141 
2700 data 167, 108. 166,248,232, 169 
2710 data 0,202,240, 43, 24,105 
2720 data 1,201, 10,240, 3, 76 
2730 data 3,105,169, 1, 24,109 
2740 data 166, 108,201, 58,240, 6 
2750data141,166, 108, 76. 1,105 
2760datal69, 48,141,166,108,169 
2770 data 1, 24,109,165,108,141 
2780 data 165, 108, 76, 1,105, 24 
2790data105, 48,141,167,108, 96 
2800datal69, 48,141,156,108,141 
2810datal57, 108, 141,158, 108, 166 
2820 data 247, 232, 169, 0, 202, 240 
2830 data 43, 24,105, 1,201, 10 
2840 data 240, 3, 76, 72,105,169 
2850data 1, 24,109,157,108,201 
2860data 58,240, 6,141,157,108 



2,168,173 
3,240, 13 
2,238, 170 
2, 76,160 



Th« Traniacter 



61 



Volwma 8, l»»u*06 | 





NO 


2870data 76, 70,105,169, 48,141 


JD 


3530 data 


71, 


69, 


32, 


34, 


80, 82 




CO 


2880 data 157, 108, 169, 1, 24,109 


IG 


3540 data 


73, 


78, 


84, 


69, 


82, 34 




JG 


2890data156, 108, 141,156,108, 76 


GB 


3550 data 


32, 


13, 


13, 


32, 


32, 32 




PO 


2900 data 70,105, 24,105, 48,141 


PC 


3560 data 


32, 


32. 


32, 


32, 


32, 18 




AK 


2910data158, 108, 96,165,113,141 


OE 


3570 data 


32, 


40, 


67, 


41, 


32, 49 




GH 


2920 data 240, 2, 165, 114,141,241 


JJ 


3580 data 


57, 


56, 


52, 


32, 


66, 89 




G 


2930 data 2, 32,232,104, 32,232 


KJ 


3590 data 


32, 


78, 


79, 


69, 


76, 32 




JO 


2940 data 104, 96,173,242, 2, 32 


NM 


3600 data 


78, 


89, 


77, 


65, 


78, 32 




PB 


2950data232, 104, 173,-243, 2, 32 


NH 


3610 data 


13, 


13, 


13, 


31, 


87, 73 




KF 


2960 data 232, 104, 24,173,246, 2 


DO; 


3620 data 


76, 


76, 


32, 


89, 


79, 85 




IK 


2970 data 109, 242, 2,141,242, 2 


HN 


3630 data 


32, 


69, 


78, 


84, 


69, 82 




AO 


2980 data 173. 247, 2,109,243, 2 


NM 


3640 data 


32, 


76, 


79, 


67, 


65, 84 




PO 


2990 data 141, 243, 2, 96, 32,243 


LM 


3650 data 


73, 


79, 


78, 


83, 


13, 32 




BE 


3000 data 104, 32, 56,105, 32,125 


AA 


3660 data 


73, 


78, 


32, 


72, 


69, 88 




JG 


3010 data 105, 32,142,105,160, 


NO, 


3670 data 


32, 


79, 


82, 


32, 


68, 69 




KB, 


3020 data 169, 108, 133, 140, 169, 151 


KP 


3680 data 


67, 


73, 


77, 


65, 


76, 32 




HD 


3030 data 133, 139, 177, 139,240, 7 


LM 


3690 data 


40, 


72, 


47, 


68, 


41, 63 




HD 


i 3040 data 32,232,104,200, 76,196 


^AC 


3700 data 


0, 


13, 


13, 


83, 


84, 65 




GG 


3050 data 105, 169, 0, 32,232,104 


KP 


37 1 data 


82, 


84, 


73, 


78, 


71, 32 




KE 


3060 data 32,216,105, 96,173,240 


GE 


3720 data 


77, 


76, 


32, 


76, 


79, 67 




MP 


3070data 2,133,141,173,241, 2 


KD 


3730 data 


65, 


84, 


73, 


79, 


78, 63 




CD 


3080 data 133, 142, 162, 0,165, 113 


LF 


3740 data 


32, 


0, 


13, 


13, 


69, 78 




JE 


: 3090 data 129, 141,230, 141, 165, 114 


BE 


3750 data 


68, 


73, 


78, 


71, 


32, 77 




LP 


3100 data 129, 141, 96,169, 0,141 


EF 


3760 data 


76, 


32, 


76, 


79, 


67, 65 




FE 


3110data245, 2,141,244. 2,141 


KE 


3770 data 


84, 


73, 


79, 


78, 


63, 32 




HF 


'■ 3120data237, 2, 169, 108. 133, 140 


LH 


3780 data 


0, 


13, 


13, 


76, 


73, 78 




BN 


' 3130 data 169, 59,133,139, 32,137 


Fl 


: 3790 data 


69, 


32, 


78, 


85, 


77, 66 




EJ 


3140 data 103, 165,248, 32, 38,106 


A 


3800 data 


69, 


82, 


32, 


70, 


79, 82 




DM 


,3150 data 32.210,255,165,248, 32 


KF 


38 10 data 


32, 


70, 


73, 


82, 


83, 84 




GJ 


'3160 data 54,106, 32,210,255,165 


DH 


'' 3820 data 


32, 


80, 


82, 


73, 


78, 84 




PP 


3170data247, 32, 38,106, 32,210 


G 


3830 data 


32, 


83, 


84, 


65, 


84, 69 




MM 


3180data255, 165,247, 32, 54,106 


EJ 


3840 data 


77, 


69, 


78, 


84, 


13, 40 




GO 


3190 data 32,210,255, 96, 74, 74 


LK 


3850 data 


18, 


82, 


69, 


84, 


85, 82 




M 


3200 data 74, 74, 24,105, 48,201 


BH 


3860 data 


78, 


146, 


32, 


70, 


79, 82 




GP 


3210 data 58,176, 1, 96, 24,105 


EL 


3870 data 


32, 


49, 


48, 


48, 


48, 48 




GB 


3220 data 7, 96, 10, 10, 10. 10 


IL 


3880 data 


41, 


63, 


32, 


0, 


13, 13 




BO 


3230data 32, 38,106, 96, 32,125 


PM 


3890 data 


76, 


73, 


78, 


69, 


32, 78 




AO 


3240 data 105, 32,142,105,169,153 


EN 


3900 data 


85, 


77, 


66, 


69, 


82, 32 




Bl 


3250 data 32,232,104,169, 34, 32 


GA 


391 data 


73, 


78, 


67, 


82, 


69, 77 




KA 


3260 data 232, 104, 96, 32,194,106 


LM 


3920 data 


69, 


78, 


84, 


32, 


13, 40 




DF 


3270 data 32, 62,106,165,254, 10 


LP 


3930 data 


18, 


82, 


69, 


84, 


85, 82 




AK 


3280 data 144, 15,169, 18, 32,232 


BM 


3940 data 


78, 


146, 


32, 


70, 


79, 82 




HA 


3290 data 104, 169, 34, 32,232,104 


LN 


3950 data 


32, 


49, 


48, 


41, 


63, 32 




NC 


3300data169, 34, 32,232.104,198 


EM 


3960 data 


0, 


147, 


17. 


17, 


17, 17 




JA 


3310 data 113, 208, 2, 198, 114, 160 


KP 


3970 data 


17, 


17, 


17, 


17, 


17, 29 




DC 


3320 data 1,169, 108, 133,140, 169 


NC 


3980 data 


29. 


29, 


29, 


29, 


29, 29 




AF 


3330 data 133, 133, 139, 177, 139,240 


KD 


3990 data 


29, 


67, 


82, 


69, 


65, 84 




KA 


'3340 data 10, 32,232,104,200,238 


GB 


4000 data 


73, 


78, 


71, 


32, 


80, 82 




'HK 


■ 3350data244, 2, 76,121,106,169 


JD 


4010 data 


73, 


78. 


84, 


32, 


83, 84 




FG 


3360data 1, 141,237, 2, 76, 24 


HH 


4020 data 


65, 


84, 


69, 


77, 


69, 78 




OF 


3370 data 103, 173,237, 2.208, 5 


MD 


4030 data 


84. 


13, 


13, 


29, 


29, 29 




'kh 


, 3380 data 169, 34, 32,232,104,169 


JG 


4040 data 


29, 


29, 


29, 


29, 


29, 29 




IE 


; 3390 data 0, 32,232,104, 32,216 


K 


4050 data 


29, 


29, 


70, 


82, 


79, 77 




EM 


3400 data 105, 169, 0, 32,232,104 


PG 


4060 data 


32, 


65, 


68, 


68, 


82, 69 




M 


3410 data 169, 0, 32,232,104, 96 


PD 


4070 data 


83, 


83, 


32, 


32, 


32, 32 




OK 


3420 data 173, 237, 2,208, 5,169 


iAL 


4080 data 


32, 


32, 


0, 


19, 


17, 17 




AJ 


3430 data 34, 32,232,104,169, 


KG 


4090 data 


17, 


17, 


17, 


17, 


17, 17 




CP' 


3440 data 141, 236, 2, 32,232,104 


N 


4 1 00 data 


17. 


17, 


17, 


29, 


29, 29 




BF 


3450 data 32,216,105, 96,169, 34 


PK 


41 10 data 


29, 


29, 


29, 


29, 


29, 29 




GG 


3460 data 32,232,104.169, 59, 32 


JL 


4 1 20 data 


29, 


29, 


29, 


29, 


29, 29 




FB 


3470data232, 104, 169, 0, 32,232 


DM 


4130 data 


29, 


29, 


29, 


29, 


29, 29 




JP 


3480 data 104, 32,216,105, 96,147 


KJ 


4140 data 


29, 


29, 


32, 


0, 


4, 68 




CJ 


3490 data 32, 32,142, 32, 32, 32 


PJ 


4150 data 


72, 


13, 


20, 


12, 


48, 49 




GO 


3500data 32,151, 18, 32, 77, 65 


OJ 


4160 data 


50, 


51, 


52, 


53, 


54, 55 




FF 


3510 data 67, 72, 73, 78, 69, 32 


jMM' 


4170 data 


56, 


57, 


13, 


20, 


18, 48 




NG 


3520 data 76, 65, 78, 71, 85, 65 


GM 


4180 data 


49, 


50, 


51, 


52, 


53, 54 



yolmw> 5, liiu«06 I 



Tlw Trantoctor 



62 





CA 


i 41 90 data 55, 56, 57, 65, 66, 67 


EH 




1420data 1, 24,109,235, 29,141,235, 29 




BN 


4200 data 68, 69, 70, 13, 20, 34 


AN 


1430 data 76, 58, 28, 24,105, 48,141,237 


1 


LN 


4210data199, 40, 51, 52, 41,199 


FO 


1440data 29, 96,169, 48,141,226, 29,141 




BJ 


4220 data 40, 51, 52. 41,199, 40 


CA 


1450data227, 29,141,228. 29,166,247,232 




HL 


4230 data 50, 48, 41, 34, 0,151 


Nl 


1460data169, 0,202,240, 43, 24,105, 1 




CB 


4240 data 50, 48, 57, 44, 48, 54 






ON 


4250 data 48, 58,151, 50, 49, 48 






HP 


4260data 44, 48, 48, 51, 58,151 


Listing 3: second loader for VIC version 




CE 


4270 data 50. 49, 49, 44, 48, 58 






CN 


4280 data 151, 50, 49, 51, 44, 50 


KB 


1 rem* second data loader for printing ml « 




KJ 


4290 data 53, 53, 0, 


JJ 


15 rem* vie version • 




LI 


20cs = 




FM 


30 for i = 7303 to 7678:read a:poke i,a 


Listing 2; first loader program for VIC-20 version 


DH 


40cs = cs + a:nexti 




GK 


50: 




KK 


1 rem* first data loader for " printing ml " • 


GJ 


60 if cs<>33737thenprint' •*** error in data 




L 


20cs = 




statements •-•• ": end 




LL 


30 for i = 6927 to 7302:read a:poke i,a 


AF 


80 end 




DH 


40cs = cs + a:next i 


IN 


100: 




GK 


50: 


CA 


1000data201, 10,240, 3, 76,129, 28,169 




Jl 


60if cs<>43462thenprint""** error in data 


CN 


1010 data 1, 24,109,227, 29,201, 58,240 






statments ****': end 


BC 


1020data 6,141,227, 29, 76,127, 28,169 




AF 


80 end 


ME 


1030data 48,141,227, 29,169. 1, 24,109 




N 


100: 


CG 


1040data226, 29,141,226, 29, 76,127, 28 




1 1 

G 


1000 data 160, 16,132,114,160, 1,132,113 


G 


1050data 24,105, 48,141,228. 29, 96,165 




HK 


1010 data 136, 140, 0, 16,140,244, 2.140 


AA 


lOeOdata 113, 141,240, 2,165,114.141,241 




MP 


1020 data 245, 2,140,237, 2,140,236, 2 


CD 


1070 data 2, 32. 33, 28, 32, 33, 28, 96 




PA 


1030 data 173, 253, 2, 133, 248, 173, 252, 2 


NE 


1080 data 173, 242, 2, 32, 33, 28,173,243 




NB 


1040 data 133, 247, 173,249, 2, 141,243, 2 


IF 


1090data 2, 32, 33, 28, 24,173,246, 2 




KO 


1050 data 173, 248, 2, 141,242, 2, 32,231 


JE 


1100 data 109, 242, 2,141,242, 2,173,247 




KL 


1060 data 28, 32, 40, 29, 32, 52, 29,169 


DM 


niOdata 2,109,243, 2,141,243, 2, 96 




HE 


1070 data 0,141,237, 2,168,177,247,133 


Kl 


1120data 32, 44, 28, 32,113, 28, 32,182 




EO 


1080 data 254, 201 , 1 28, 1 76, 21 , 1 73, 245, 2 


PM 


1130data 28, 32,199, 28,160, 0,169, 29 




CA 


I090data201, 1,208, 32,169,146, 32, 33 


CK 


1140dala133, 140, 169,221,133, 139, 177, 139 




PK 


1100 data 28,206,245, 2,238,244, 2, 76 


AL 


11 50 data 240, 7, 32, 33, 28,200, 76,253 




FF 


1110data123. 27, 173.245. 2,201, 1.240 


BO 


11 60 data 28,169, 0, 32, 33, 28, 32. 17 




K 


1120data 11,169, 18, 32, 33, 28,238,245 


GM 


1170data 29, 96,173,240, 2,133,141,173 




Nl 


1130data 2,238,244, 2,165,254, 10, 74 


Dl 


1180 data 241. 2,133,142,162, 0,165,113 




MF 


11 40 data 201, 34,208, 6, 76, 69, 29, 76 


PL 


1190data129, 141,230, 141,165, 114, 129, 141 




MK 


1150data181. 27,133,254, 10, 10,176, 16 


HN 


1200 data 96,169, 0,141,245, 2,141,244 




OJ 


lieOdata 10,144, 5,165,254, 76,175, 27 


ND 


1210data 2,141,237, 2, 96, 32,182, 28 




BN 


1170data165,254, 24,105, 64, 76,175, 27 


EP 


1220 data 32,199, 28.169,153, 32, 33, 28 




Gl 


llSOdata 10,144, 8,165,254, 24,105, 64 


OB 


1230data169, 34, 32, .33, 28, 96, 32,184 




PE 


1190data 76,175. 27,165,254, 24,105,128 


BO 


1240 data 29, 32, 52, 29,165,254, 10.144 




BM 


1200 data 32, 33, 28,238,244, 2,238,236 


DH 


1250 data 15,169, 18, 32, 33, 28,169, 34 




DM 


1210 data 2, 230, 247, 208, 2, 230, 248, 173 


KH 


1260 data 32, 33, 28,169, 34, 32, 33, 28 




BN 


1220 data 250, 2, 1 97, 247, 1 73, 251 , 2, 229 


JP 


1270data198, 113, 208. 2,198,114,160, 1 




HP 


1230 data248, 176, 6, 32,133, 29, 76,248 


HP 


1280 data 169, 29, 133, 140.169.203, 133,139 




BP 


1 240 data 27, 1 73, 236, 2, 201 , 255, 208, 6 


CB 


1290 data 177, 139,240, 10, 32, 33, 28,200 




BC 


1250 data 32,162, 29, 76, 61, 27,173,244 


OC 


1300 data 238, 244, 2, 76,111, 29,169, 1 




HA 


1260data 2,201, 57,144, 11, 32,184, 29 


KD 


1310data141,237, 2, 76,181, 27,173,237 




LI 


1270data 32, 52, 29,169, 0,141,244, 2 


FE 


1320 data 2,208, 5,169, 34, 32, 33, 28 




MN 


1280 data 76, 70, 27,230,113,208, 2,230 


IF 


1330 data 169, 0, 32, 33, 28, 32, 17, 29 




DD 


1290data114, 165, 113, 133, 45,133, 47,133 


11 


1340 dala 169, 0, 32, 33, 28,169, 0. 32 




NM 


1300dala 49,165,114,133, 46,133, 48,133 


CP 


1350 data 33, 28, 96,173,237, 2,208, 5 




CM 


1310 data 50,169,255,133, 51,133, 53,133 


AH 


1360 data 169, 34, 32, 33, 28,169, 0,141 




KG 


1320dala 54.133, 55,169, 29,133. 56,133 


KH 


1370data236, 2, 32, 33, 28, 32, 17, 29 




LF 


1330data 52,169, 1,133, 43,169, 16,133 


MB 


1380 data 96,169, 34, 32, 33, 28,169, 59 




LE 


1340data 44, 96,162, 0,129,113,230,113 


LH 


1390 data 32, 33, 28,169. 0, 32, 33, 28 




MD 


1350data208, 2,230,114, 96,169, 48,141 


NE 


1400data 32, 17, 29, 96, 34,199, 40, 51 




GA 


1360data235, 29,141,236, 29,141,237, 29 


FM 


1410data 52, 41,199. 40, 51, 52, 41.199 




DM 


1370 data 166, 248, 232, 169, 0, 202, 240, 43 


BK 


1420data 40, 50, 48, 41, 34, 0,151, 50 




IN 


1380data 24,105, 1,201, 10,240, 3, 76 


EE 


1430 data 48, 57, 44, 50, 53. 50, 58,151 




DO 


1390data 60, 28,169, 1, 24,109,236, 29 


CP 


1440 data 50, 49, 48, 44, 50, 48, 55, 58 




01 


1400dala201, 58,240, 6,141,236, 29, 76 


MA 


1450data151, 50, 49, 49, 44, 48, 58,151 




FN 


1410data 58, 28,169. 48,141,236, 29,169 


MJ 


1460 data 50. 49, 51. 44, 50, 53, 53, 


Tha Tkro nsocto r '^^ 


1 


Voluma 5, Issue 06 | 



Aligning The Commodore 
1541 Disk Drive 



Bob Drake 
Brantford, Ont. 



WARNING: 

FOLLOWING THE STEPS IN THIS ARTICLE 
COULD RESULT IN DAMAGE TO YOUR DISK 
DRIVE AND WILL VOID ANY WARRANTY 



The warning above is real and should be read carefully. Any 
time you open a sealed unit, whether a disk drive or an electric 
toaster, you will void any warranty on the unit. You may also 
damage the unit. Damage may occur regardless of the instruc- 
tions you are following. You may injure yourself while attempt- 
ing repairs. Electrical equipment always carries with it the risk 
of shock and electrocution, BUT, . ,if you are careful and 
patient, you can align your disk drive and save up to $70. 



4- Turn the drive right way up. Don't lose any of the four 
screws. Gently lift the top off and set it to one side. Don't sit 
or step on it — that plastic shell will break easily. 

5- Find the red and black wires leading from the power light 
onto the main circuit board you should now be looking at 
and unplug it. Note where it came from — you have to put it 
back. (Figure 1) 



If your disk drive is still under warranty, DON'T FIX IT. Take 
the drive back to your dealer for repair or replacement. Doing 
anything else is foolish. 



6. The disk drive is held into the bottom half of the case with six 
(6) Phillips screws driven into the plastic. Remove them and 
set them to one side, (Figure 1) 



The other step to take before opening the case is to make sure 
that indeed alignment is needed. In other words, IF IT AIN'T 
BROKE, DON'T FIX IT. Be sure the drive is out of alignment 
before you start. Use the test demo disk that comes with your 
drive and check the alignment using PERFORMANCE TEST, If 
that program says the drive is alright, then something else is 
wrong. If you can't gel PERFORMANCE TEST to load, then try 
the single line programs included here. But be sure BEFORE 
you start. 1 have used these instructions to align 1 1 disk drives 
this fall in the school at which I work. Only one would not 
align. Later work traced its problems to a bad chip. 

1. Read these instructions all the way through one or more 
times. Be sure you understand what they say BEFORE you 
start. 

2- Find a dry, stable place to work. You will need a diskette that 
can be erased, the TEST DEMO disk that came with the 
drive, a medium Phillips (star head) screwdriver and a sharp 
pointed knife (the smaller the better). 



7. CAREFULLY not using the circuit board, lift the disk drive 
out of the bottom of the case, turn the case over, and insert 
one of the metal tabs on the drive into a slot on the plastic 
bottom. The drive should stand self supported. (Figure 2) 

8. Find the two screws on either side of the stepper motor. 
CAREFULLY use the knife to scrape away the green glue 
holding those screws down. Don't cut any wires accidentally 
or you could be buying a new drive. This is, for me, the 
hardest part of the job. When the glue is broken off. use your 
screwdriver to undo each screw slightly (no more than 2-3 
full turns). Turn the stepper motor fully clockwise. Note — it 
only moves about a quarter of an inch at most. (Figure 3) 

9. Plug the drive into the computer. Plug the power back into 
the drive. KEEP YOUR FINGERS OFF ANY PART THAT 
LOOKS LIKE IT COULD CARRY POWER, Turn on the 
power. 

1 0. The drive will not be far out of alignment. 



3. Unplug the disk drive from the C64 computer and from the 
power source (wall plug). Turn the disk drive upside down 
and use the screwdriver to remove the four screws from the 
bottom of the unit. (You just voided the warranty!) 



Insert your TEST DEMO disk and VALIDATE it using: 

open1,8,15,"v0" : close 1 



Th«Tran»acter 



64 



Vblume 5, In U9 06 



When m alignment, Ihe red light on the front of the drive 
should slay on without flickering. Gently move the stepper 
motor {about 1 /32 inch at a time) until the red light stays on. 
You may have to validate the disk several times. Tighten one 
screw. 

Format a blank disk using; 

open1,8J5/nO;test,tt" : close 1 

Watch the light — it should stay on. Expect that 3 or 4 tries may 
be needed. 



alignment. Be sure that tracks 1 and 35 will both read and 
write, 

13. Unplug the drive. 

CAREFULLY, lift the drive, turn the bottom over and place 
drive back into the bottom. 

Replace the 6 screws holding the drive in the plastic bottom, 
replace the red-black wires to the green light, and put the top 
back on. Finally, turn the drive over and replace the 4 screws in 
the bottom. 



^2. When you are sure the drive is aligned, run the PERFORM- 14.C0NGRATULAT10NS! You have just aligned your 1541 disk 
ANCE TEST from the TEST DEMO disk to confirm the drive. 



Speed Control 



Screws 




Front 



Figure 1 




"T1 

p 



n 





Stepper Motor 




Bottom 




Bottom Case 
Upside Down 



Figure 2 



Figures 



Glued Down 



Cabled Wire 
Don't Cut 




Glued Down 



Th« l^anvocfor 



69 



Volom» 5, l**ue OtT^ 




Super Cat 

Richard Evers, Editor 



Super Cat is a program writlen for the sole purpose of providing all 
that detailed directory information that we all require, but have such a 
hard time locating. Whatever is lucked away on the directory track of 
your diskette magically reappears with (he use of Super Cat. For an 
added bonus, the output can be generated to your screen or attached 
printer Look below for a quick synopsis of available data to be 
generated by the program : 

Super Cat will display the directory track and sector, and the index 
into the sector that the filename resides on. It will also provide you 
with the usual data of block count, file name, and file type. Along with 
this, the track and sector of the first data block of the file itself is given. 
As a final bonus lo REL file type users, the program will show the first 
side sector Irack and sector link, plus the record length of each record 
within the file. This is the sum and total of data that will become 
available to the Super Cat user. 

Here's what to expect when generating reports with the program. 

39:16:66 63 mlm 64.pai prg trk 50 sec 19 

Above is a regular display for a file, excepting REL The first three 
numbers, "39:16:66" refer to the directory track, sector, and index 
ii^to the sector that the filename has been located on. The next 
number, "63" is the block count consumed by the file on diskette. The 
data following is the filename followed closely by the file type. After 
that comes the track and sector that the first data block is held on. 
That's everything. 

39:1:2 727 writer-datal rel trk 38 sec I ss : trk 38 sec 8 len 254 

This display line is from a REL type file entry. Everything is the same 
till you get past the track and sector link to the first data block. From 
"ss" on, the data printed refers to the first side sector block. In This 
example, the first side sector is located on track 38, sector 8, with a file 
length of 254 characters. 

When the entire directory has been peered through by the program, 
the total number of blocks consumed by the programs in the directory 
are display, as shown below. 

. . . total * blocks used : 2054 . . . 

The program has been writlen lo work with ail Commodore floppy 
drives, and will even allow for a selective evaluation of the directory 
by using the pattern matching capabilities of the Commodore DOS, 



10 
HA 

PE 
EK 

MK 
MH 

NP 
JM 
PH 
00 
HP 
00 
BE 

FC 
01 
GL 
CM 

KL 
HH 
JL 
AK 
FP 
DP 

OB 

JC 

GC 
MG 
HG 

IB 

NF 
.IE 
BG 

PC 

GP 

OK 

CA 

MK 

IB 

HN 

FF 

FF 

HP 

KD 



1 rem save " @0:super cat,bas ' ,8 

100 rem ** rte/84-asupercataIogroutine that supplies 

all file info 
no print "'• .super catalog- rte/84 ♦* ' 

120ft$(0)='der;ft$(l)=:"seq':ft$(2)=''prg": 

ft$(3)-'usr':ftS(4)-"rer 
130 print'drive type :" 

140 inputM) 1541/2031/4040 or 2)8050/8250 :\ty: 

ifty<l orty>2then 140 
1 50 dirk = 39: if ty = I then dirk = 1 8: rem • * directory track 
160inpul"dnve*-;dr:ifdr>lthen 160 
170 print "selective directory?" 

180print"l)seq, 2)prg, 3)usr, 4)rel,5)air 
190 input si: ifsKl orsl>5then \% 
200 sl$ = " ail ■ : if sl<5 Then slS = ft$(sl} 
210 input " 3) screen or 4) printer : " ;dv: 

ifdv<3ordv>4 then 210 
220 open 15,8,15: open 5,8,5,'*": open I, (dv) 
230sec=l;clr = 0: bu = 0: z$ = chr$(0): sp$=^ " " 
240print*15,"ul; "5:dr;dlrk;sec: rem -- block read 
250 print*! 5, "b-p: ''5:0:ctr=0; rem ** position the 

buffer pointer 
260gel*5.nl$,ns$: rem ** next track/sector links 
270 get"5,ft$: ft = asc(ft$ + z$)andl5: if ft>4 then ft = 
280 ft$ = ft$(fl}: rem •-' assign file type 
290 get'5,l$,sS: rem ** first data Irk/sector 
300 trk = asc(t$ -f z$); ski = asc(s$ + zS) 
310fi$=":forx=ltol6:get'5,aS:f]$ = (l$ + 

chr$(asc{aS-fz$)): next: rem filname 
320 get'5,sr$,ss$,rl$: rem ** first trk/sec side sector + 

length if rei file 
330 sr = asc(sr$ + z$): ss = asc(ssi + z$); rl =asc(rlS + z$) 
340 get*5,gb$,gbS,gb$,gbS,gb$,gbS: rem *' 6 bytes not used 

350gef5,bi$,bh$:blks = asc(blS + zS) + 256*asc(bh$ + zS) 
360 get*5,gbS,gb$: rem •• two wasted bytes at start of 

next record 
370iffl = 0then470 

380dp$ = mid$(str$(dtrk),2)+ ": " -fmidS{slr$(sec),2}+ ":" 
390 dp$ = dp$ -f mid$(str$(ctr*32 + 2),2) 
400 dp$ = midS(dp$ + spS, 1 ,len(dpS) + (1 0-len(dp$)))+ 

rightS(sp$+str${blks},5)+ " " 
410 if sis = 'air then 430: rem ** everything ok 
420 if sl$<>ftS then 460 : rem * * file type incorrect 
430print*l,dp$fl$^ "ft$" trk "trk ^ec" ski; 
440 if ft$<> " rel " then print"! : goto 460 
450prinl*l,^ss:lrk"sr"sec'ss"len"rl 
460bu = bu4-blks: rem ** blocks used in total 
470 ctr=ctr+ 1: if ctr<8 then 270 
480 dirk = asc(nl$ + z$): sec =asc{ns$ + z$) 
490 if dtrk then 240 

500 primal, \ ., total * blocks used :" bu "... " 
5lOclosel:close5: closel5:end 



Thft Tmniactor 



66 



Volume 5, Ittu* 06 



Software Numeric Keyj 
For the Commodore 64 



V J 

Michael Kwun 
Okemos, MI 




"It's expandable to 48 keys 



1 1 



The following program was wrillen because of the weallh of 
Commodore 64 programs which contain DATA statements. 1 
often overlook interesting looking programs printed in maga- 
zines due to the multitude of data statements found within and 
my lack of proficiency with the top row on the keyboard (the 
numbers). Wouldn't it be nice to have a numeric keypad? 

One day while looking over a memory map searching for some 
ROM routines, I found the following entries: 

EB81 60289 Keyboard 1 - unshifted 
EBC2 60354 Keyboard 2 - shifted 

Investigating these locations, it turns out that by changing their 
values (by transferring the ROM to RAM and switching the 
Kernel out}, you can change the characters that are accessed by 
each key. The following program, "Software Numeric Keypad", 
was written using this knowledge. 

Type it in with any machine language monitor, and save it. To 
use it, just load it and run. After a brief pause, the ''READY," 
prompt will appear. The keyboard has been redefined, and at 
this point the program is no longer required. These are the key 
re-definitions: 

789 (no change) 789 

UIO changes to 456 

JKL changes to 123 

M,, changes to 00, 



To return the keyboard to normal, use RUN -STOP/ RESTORE 
or POKE 1,55 (the poke is tricky to enter in numeric keypad 
mode). To regain access to the numeric keypad, enter POKE 
1.53. While in the numeric keypad mode, the U, I, 0. J. K, L 
and the period can be accessed by pressing SHIFT. The '<' and 
the >' can be accessed by using the Commodore key, Happy 

typing! 



Hex dump of the program: 



0801 


OB 


08 


OA 


00 


9E 


32 


30 


36 


0809 


31 


00 


00 


00 


A9 


AO 


85 


FC 


0811 


A9 


00 


85 


FB 


AO 


00 


B1 


FB 


0819 


91 


FB 


C8 


DO 


F9 


E6 


FC 


A5 


0821 


FC 


C9 


CO 


DO 


F1 


A9 


EO 


85 


0829 


FC 


AO 


00 


B1 


FB 


91 


FB 


08 


0831 


DO 


F9 


E6 


FC 


00 


F5 


A9 


35 


0839 


85 


01 


A2 


12 


BD 


4C 


08 


90 


0841 


9E 


EB 


BD 


5E 


08 


9D 


DF 


EB 


0849 


CA 


DO 


F1 


60 


34 


56 


39 


35 


0851 


31 


30 


30 


32 


36 


4E 


2B 


50 


0859 


33 


2D 


2C 


3A 


40 


30 


55 


06 


0861 


29 


49 


4A 


30 


4D 


4B 


4F 


CE 


0869 


DB 


DO 


4C 


DD 


2E 


5B 


BA 


20 



Now save from $0800 to $0871. 



TtM TranKictor 



67 



Volum«5, l»u»06 



Disk/Extramon 64 



Mike Forani 
Burlington, Ontario 



Disk/Extramon 64 is the o/l-in-one ultra-monitor for the Commodore 64. It has just about 
everything you could ask for. and then some. Just one problem though - it's over 7K long! 
And 8 pages of DATA statements not only consumes too much magazine space, but makes 
hand entry far too impractical. So why prim inslructions without the program? Mike uses 
standard commands and command syntax which mokes the instructions practically 
universal for all other monitor utilities. Mike's program may have commands that the 
others don 'I, but odds are the others have none that Mike doesn f include. Two assembled 
versions of Disk/Extramon 64 are available on Transactor Disk *5. - M.Ed. 



Embarking on an investigative journey through your 64? Yes? Then 
Disk/Extramon 64 is a travel companion you shouldn'l be without. 
It's the monitor program to end all monitor programs. 

A lot of you may be saying, "Why should I bother with this one?". 
Agreed, there are several monitor programs around, some for sale, 
others for free. Disk/Extramon 64 has features not found in other 
monitors which was going to be a strong "selling point" for the 
program. However, the program is now public domain so all those 
selhng points make the fact that it's free even more attractive, 

Disk/Extramon 64 has all the common machine language monitor 
commands such as Hunt, Assemble and Disassemble^ Transfer, plus 
Newlocate, Interrogate, Compare, Quick Trace, and Bank Switching 
commands especially for the 64. Hex/Decimal conversions are in 
there loo. 

The Disk Monitor portion of the program has everything the budding 
young drive programmer needs for experimenhng with the inner 
workings. 

Note: The program has been tested with Commodore equipment 
only. I therefore cannot insure that it will work properly with non- 
Commodore printers, disk drives, or IEEE interfaces. (There has been 
some success with the 4040 dual drive and the Bus-Card II interface,) 

The following is a list of the Disk/Extramon 64 commands. Some of 
the commands require special attention so please read on. 

Affected Memory 

This program is located at $ 1 000 or at $8000 and uses 8K of memory. 
The page 3 vectors; IRQ, BRK, and ICRNCH are changed and the 
upper 5 bytes of page are used by the monitor program. A number of 
kernal routines are also used and these will affect some zero page 
variables. CHRGET is used by the monitor program and this will affect 
the page 2 input buffer. On a break instruction before anything can 
change, zero page and page two are saved at $9e00 to $9fff with the 
$8000 version or at $2eOO to $2fff with the $1000 version of the 
monitor program. Therefore you will always be able to see what zero 
page or page two locations your program affected. Also on a break 
instruction the VIC chip's video and character generator registers are 
reset to their defaults as is the I/O port in page 0. 

Note: While in the monitor all numeric input must be in hexadecimal 
numbers except when doing decimal to hexadecimal conversion. 



Monitor Commands 



DISPLAY REGISTERS: Display the current processor status. 



DISPLAY MEMORY: Display contents of memory in hex. 
m adrl adr2 adrl ;beginning address 

adr2 ;ending address (optional) 
If adr2 is left out then one line of eight bytes will be displayed. 

ALTER MEMORY: Alter contents of the 64's memory 
.: 1000 00 00 00 00 00 00 00 00 alter memory 

ALTER REGISTERS: Alter contents of 64's processor registers. 

pc irq sracxryr sp 
-! 1000 ea31 bO 00 00 00 ff alter processor status 

GO; Begin execution of a machine language program, 
gadrl adrl ;beginning address of execution (optional) 

• If the kernal is banked out the processor status is not restored at the 
'go' command and the IRQ's are disabled. Also if the address is 
omitted or invalid, the 64 will jump to address in the program counter, 

LOAD: Load a program into the 64's memory. 
1 " «dr:filename " ,dii,adrl 

sdr ;source drive number (optional) 

dn ;device number (08 - 00 

adrl ;load address (optional, defaults to the disk load address) 

SAVE: Save a program from 64 to disk- 
s " ddr:filename " ,dn,adrl ,adr2 

ddr ;destJnation drive '*' (optional) 

dn :device numl>er (08 - Of) 

adrl ;beginning address of save 

adr2 ;end address of save (last byte is saved) 

EXIT; Exit the monitor to BASIC, 

X * All wedges are left intact so the monitor may be reentered. 



Extra Monitor Commands 

MONITOR: Enter monitor from BASIC 
moQ 



I Tlw Tro rwi ctor 



68 



Volums 5, l»ua 06 



BANK: The kernal and/or basic may be banked out of memory so 
that the RAM memory sitting behind il may be modified, 
assembled, saved, executed or traced. 

bbout bank ouf the basic ROM to give RAM 

bbin bank in the basic ROM 

bkout bank out the kernal ROM to give RAM 

bkin bank in the kernal ROM 

TRANSFER; A portion of memory may be transferred from one 

memory location to another. 

ladrl adr2adr3 adrl ;stan address 

adr2 ;end address 
adr3 ;beginning address of transfer 

RLL: Fill a portion of memory with a given value, 
f adrl adr2 xx adrl ;start address 

adr2 ;end address 

XX ;value to fill memory with 

HUNT: Hunt for a string of values in a specified portion of memory. 

h adrl adr2 'siring' adrl ;start address 

h adrl adr2 xx xx xx adr2 ;end address for hunt 

"string' ;characters to be searched for 
XX ;hex values to be searched for 

(max. length of string or bytes is 20) 

COMPARE: Compare two portions of memory to each other. 

c adrl adr2 adr3 adrl ;start address 

adr2 ;end address 
adr3 ;start address (second block} 

* memory locations that do not compare equal will be displayed. 

INTERROGATE: Display the screen printable characters along with 

the memory locations values. 
] adrl adr2 adrl ;start address 

adr2 ;end address (optional) 

QTRACE: Trace a machine language routine and display the proces- 
sor status after each instruction is executed. 
q adrl adrl ;address to begin execution 

• Pressing the 'n' key skips the trace 

• Pressing the 'm' key speeds it up 

• Pressing the space bar halts execution 

* No separate interrupt control, unless non maskable, is allowed 
during the trace routine and any i/o routines may be affected. The 
qtrace works on an interrupting system. Interrupts occur after each 
instruction is executed, therefore IRQ control in the program being 
traced may crash the system. (CIA "1 - Timer A is used for interrupt 
timing.) 

ASSEMBLE: Assemble a machine language program in memory. 

(this is a simple assembler) 
a adrl lda*$41 adrl ;beginning address for assembly 

* To end assembling a return (blank line) must be entered before 
doing any other operations such as ahering the assembled code. 

DISASSEMBLE; Disassemble hexadecimal memory location values 

into mnemonic op-codes with operands. 

d adrl adr2 adrl ;start address 

adr2 ;end address (optional) 

* If adr2 is leh out then only one op-code and its operand will be 
displayed. 



ALTER DISASSEIHBLY: Change the screen disassembly. 
., 1000 20d2ff jsrSffd2 

' The hex values are to be changed not the mnemonics. 

NEW LOCATER: Relocate a machine language program, 
n adrl adr2 offset adr3 adr4 w 

adrl ;beginning address of code to be relocated 

adr2 ;end address 

offset ;value to be added to absolute indexed memory Iocs* 

lions 
adr3 ;lower address limit of absolute addressed data which is 

fo be changed 
adr4 ;upper limit 

w ;relocating a word table - if included 

* The code to be relocated must first be transferred, this is a two step 
command, 

DEC/HEX CONVERSION: Convert a hexadecimal number to a 

decimal number or a decimal number 
to a hexadecimal number 

'65535 ;decimal to hexadecimal 

•$ffff ;hexadecimal to decimal 

KILL: The disk/extra monitor wedges are destroyed and normal 
basic operations may be done - the monitor may not be 
reentered unless you jump to the start of the program, ie. 
$1000 or $8000, 

k * All the page three vectors used are restored. 

COLD: Do a power on reset sequence. 



L.-- t 



Disk Monitor Commands 

DIRECTORY: Do a screen list of the directory. 
/ ;directory of disk 

/ " m* ;directory of files starting with the letter 'm 
/ ■ 1: ;directory of drive 1 

READ: Read a sector from the disk to a disk buffer, 
Srddttasbb dd :drive 

tl ;track 

ss ; sector 

bb ;buffer (optional, default is 01) 

WRITE: Write a disk buffer to the disk surface. 
$w dd tt »s bb dd ;drive 

tr ;track 

ss ;sector 

bb;buffer (optional) 

GET: Get disk memory to the 64"s memory. 

Sg adrl adr2 adr3 adrl ;start address of get 

adr2 ; end address 
adrS ;address to store at in C64 

PUT: Put 64's memory to disk memory. 

$p adrl adr2 adr3 adrl ;starl address of put 

adr2 ;end address 

adr3 ;address to store at in drive 



Th« TranKictor 



69 



VoJum» 5r l»if« 06 



VIEW: View the disk drives memory. 
$vadrladr2 ddrl ; start address 

adr2 ;end address {optional} 

ALTER: Alter the disk drives memory. 
.$:0300 00 00 00 00 00 00 00 00 

DIRECT: Send a direct command to the disk drive. 
$> , . • ;any basic 2.0 disk command 

* The disk status is displayed after the command is executed. 



Note 1 After doing any disk memory commands the drive should be 
initialized to avoid any unfriendly errors. (S>i0) 

Note 2 An automatic scroll up and down is built into the memory 
display routines and the disassemble. 

Note 3 Pressing the run/ stop and restore keys will reset the com- 
puters pa^e 3 vectors, this will result in the monitor not 
working on the scroll rouhnes therefore the monitor must be 
exited and reentered at its starting point to reset the vectors 
once more. 



TRACE: Trace a files track and sector Unks and display ihem. (begin 

tracing al. . .) 
$tdd ttsftbb dd;drive 

tt ;track 

S5 ; sector 

bb ;buffer (optional) 

FETCH: Fetch a sector from the disk drive surface to the 64's 

memory, 
$fadrl dd ttssbb adrl ;start address in C64 

dd ;drive 

tt ;lrack 

ss ; sec tor 

bb ;buffer (optional) 

DUMP: Dump a block of the 64's memory to the disk surface. 
$d adrl dd tt ss bb adrl ;start address in C64 

dd ;drive 

tt ;track 

ss ; sec tor 

bb ;buffer (optional) 

CHANGE: Change the device number of the disk drive, (send to drive 

or just Jor program defaults,) 
Sc do dn« do ;old device number 

dn ;new device number 

• If the asterisk is included the change is only done in the 64's 
memory so that a device 09-Of may be used as a default if hard wired. 

ALLOCATE: Allocate a sector as being used in the BAM. 
$addtts« dd ;dnve 

tt ;track 

ss ; sec tor 

• To de-allocate sectors use the basic 2.0 command Validate (vO) 

EXECUTE: Execute disk memory. 
$eadrl adrl ;beginning of execution 

BLOCK EXECUTE: Load a sector off the disk surface into a disk 



$b dd tt 88 bb 



buffer and execute it, 
dd ;drive 
tt :track 
ss ; sector 
bb jbuffer (optional) 



STATUS: Check the disk status, 

$8 

INTERROGATE: Display screen printable characters while display- 
ing the memory of the disk drive. 

$i adrl adr2 adrl ;8lan address 

adr2 ;end address (optional) 



Disk/Extramon 64 Quick Reference Chart 



MONITOR COMMANDS 



a adrl 

bbin 

bbout 

bkin 

bkout 

cadrl adr2 adr3 

d adrl [adr2] 

f adrl adr2xx 

gMrl] 

hadrl adr2 'string' 

h adrl adr2 xx xx xx , . . 

iadrl [adr2] 

k 

1 "sdnfiiename^dn^fadrl 

madrl [adr2] 

mon 

n adrl adr2 offset adr3 adr4 [w] 

P 

q [adrl] 

r 

s ''ddr:filenaine'',dn,adrl,adr2 

tadrl adr2adr3 

X 

* XXXXX 

*$XXXX 



simple assembler 

bank basic in 

bank basic out 

bank kernal in 

bankkernal out 

compare memory 

disassemble memory 

fill memory 

begin execution of program 

search memory for siring 

search memory for bytes 

interrogate memory 

kill monitor wedges and exit 

load a file from disk 

display memory bytes 

enter monitor from basic 

relocate program code 

do a power on reset sequence 

quick trace of program code 

display processor registers 

save a file to disk 

transfer memory 

exit the monitor to basic 

decimal to hex conversion 

hex to decimal conversion 



DISK MOfVITOR COMMANDS 



$a dd tt S8 

$bddtts8[bb] 

$c do dn 

$cdodn* 

$dadrl ddtts8[bb] 

$eadrl 

$fadrlddtt8s[bbl 

$gadrl adr2adr3 

$iadrl [adr2] 

Spadrl adr2adr3 

$rddttS8[bb] 

$8 

$tddtl8s[bb} 

$vadrl [adr21 
$w dd tt ss [bb] 
$> *string' 
/ 



allocate a sector in BAM 
block execute 

change disk device number 
change disk defauh device * 
dump memory to disk 
execute disk memory 
fetch sector from floppy 
get disk memory 
interrogate disk memory 
put memory to disk memory 
read a sector to disk buffer 
check disk status 

trace file link pointers 
view disk memory 
write a buffer to disk 
send disk command 
directory 



Th« Trontoctor 



70 



Volume 5, liiuft 06 



Drive Peeker: 
A Quick Peek 
Inside Your Drive 

Richard T. Evers 



Drive Iripping has become one of North America's prime 
vacation pastimes over the past few years. With disk protection 
making its entry in such a big way, plus so many new tricks 
being uncovered on a daily basis, dashing about within your 
drive unit is the ihing to do. 

Well, in keeping with new trends, we bring you 'Drive Peeker', 
a program guaranteed to trip the light fantastic with you 
throughout every private part of your drive. Each and every 
hidden recess is no longer so, with Drive Peeker at your side. 
Now on to a more serious vein. 

To look inside of disk memory and extract the information that 
lies within is not a difficult task. All that is required is to inform 
the drive of your intentions and proceed along with what you 
want to do. Before progressing on to the program, let's first 
explain how this can be done. 

The very firsl thing required is to place a call to the drive along 
its private channel, then keep the channel open for further 
updates of procedures. 

open 15,8,15 

Once opened up, you have to inform the disk drive the reason 
for the call. A command as follows will do the trick 

print^l 5, ' m-r " chr$(ml)chr$(mh)chr$(numctir) 

The " M-R " informs the drive that you would like to read its 
memory. CHR$(ML) and CHR$(MH) tells it whal portion of 
memory you are interested in. CHR$(numchr) is an optional 
parameter not discussed by Commodore in past. This will 
inform Ihe drive thai you would like to read the value of 
(numchr) characters at a time, (numchr) represents a number 
up to 255 decimal. To get these characters, the GET*15 com- 
mand is the used. If required, you can GET* more than one 
character at a time, ie. GET-'IS^SpbSpCS^dS . . . etc. The drive 
understands this and will return to you the number of charac- 
ters desired. 

With all disk operations using CBM equipment, a zero byte 
cannot be retrieved at all. You can write it to disk and it will 
actually make it there in one piece. Bui when you try to read it 
back, the drive unit eats it and gives you nothing in return. 
Something like a users fee. Well, whenever reading data from 
disk, a test should be made to see if the string received is 
actually there. If not, assign it with a value of chr$(0), and your 
programs will be happier. 




Once you have that byte, you can do whatever you please. In the program 
below, I have used it for one specific purpose, to show you what is hiding 
in your unit. Once the data is received, its ASCII value is OR'd with 64 to 
make it nice to work with, then it is added to a string- From there, the 
original data byte received is converted to hexadecimal and is printed 
out. A maximum of 8 bytes will be displayed per line, then the string of 
the CHR$(value or 64) will be printed. This will help you at times when 
you know you're peering at a byte table. 

Every time a line is dropped, the current location is memory is printed at 
the beginning of the new line in hexadecimal. In this way, you always 
know where the data is coming from, just in case you want to find it back 
later on. As an extra bonus, the program has been written to allow output 
to be directed to Ihe screen or printer, as you please. With everything 
taken into consideration, the routine isn't bad for the amount of work it's 
going to cost you keying it in. And, as usual, you will have learned but 
another new programming trick, to add to your already overflowing 
collection. 



100 rem save " @0:drive peeker\8:verify''0:drive peeker ", 8 

1 05 rem : * • drive peeker - rte/84 • ♦ 

110 rem : •* will scout about within your drive & report back to you •* 

115 print"** drive peeker •*' 

120fix$= "0123456789abcdef" 

125 input"fiex: start, end " ;s$,e$ 

130va$ = s$: gosub215: s = val(va$} ;rem convert start to dec 

135 va$ = e$ ; gosub215 : e==val(va$) :rem convert end to dec 

140 input "s) screen . p) printer ";sp$ 

145dv = 3: ifsp$= "p' thendv = 4 

150 open 1,(dv) 

155 open 15,8,15 

160forpk = stoestep8:vS="' 

165mh% = pk/256 : ml = pk-mh%*256 

170print#15,"m-r"ctir$(ml)chr$(mh%)chr$(8) :rem read in 8 chars 

1 75 flag = 1 : v = mhio/o : gosub 190: print#1,ht$; : v = ml : gosub 190 

:pnnt#1,ht$" ^:flag = 
180 tor x = to 7 
185get#15,a$: v = asc(a$ + chr$(0)): v$ = v$ + chr$(vor64) 

190ti0/o-v/16:lo = v-ti%'16 

195hl$ = mid$(tix$,ho/o + 1,1) + mid$(fix$,lo + 1,1); if flag then return 

200print#1,ht$" '; 

205 next X ; print#l,v$; next pk : closel : close 15; end 

210 rem hex - dec 

215ln = len{va$):f=^0 

220forx = 0toln-1 : v = asc(mid$(va$,ln-x,1))-48 : y = abs(v>9) 

225f = f-f {(v-(y*7))'16tx) : next : va$ = rnid$(str$(f),2) ; return 



Th« 'h-an factor 



71 



V6>mn# 5, U»ug 06~^ 



File Compare 



Richard Evers 



Compare Disk Files In A Flasli 

A while ago I took il upon myself Jo convert the PET resident 
monitor for the Commodore 64, Considering how many MLM's 
are already out there, this was a pretty useless task. Needless to 
say, you will never actually see the completed version in the 
pages of our magazine. To gel back to the story, troubles 
occured immediately with my assembled pseudo source. To get 
the source, 1 simply SAVEd the MLM from the PET in memory 
to disk, then disassembled it with a disk unassembler program. 
After a few mods to this apparent source, it was assembled, just 
to check if everything was OK. With a crash and heave my 
hopes dissolved, it wasn't quite right. LOAD and SAVE were 
OK, so were all but one of the other commands. G, the GO 
command, would crash the machine by trampling back into 
BASIC with the decimal flag set. It came close to driving me 
crazy because the machine would have to be powered down 
after every attempt at correcting the error. 



The programs listed below are for the sole purpose of creating a 
program on diskette with a single BASIC line to SYS to the start 
address- Once created. LOAD the new program in and RUN it 
as a normal BASIC program. The code has been written to start 
at $0401 for the PET/CBM and $0801 for the C64. The code 
cannot be relocated without reassembling the source. 

Once up and running, the first prompt will ask you for the 
device * in which to output the report to, either 3 (screen) or 4 
(printer). Answer the question, hit return and wait for the next 
question. The next prompt, 

"dr#:filename>" 

will appear. Type in the name of one of the files in which to 
compare then hit return. The prompt will then reappear imme- 
diately. Reply this time with the name of the second file. The 
compare begins. 



If a comparison of code was made between the original MLM in 
the PET, and my pseudo assembled code, the trouble could 
quickly be found. The incorrect or missing bytes would easily 
be pointed out, with the right program. An so, File Compare *1 , 
a BASIC version, was conceived. 

In reality the BASIC program took a very short period of time to 
write. How much effort does it take to OPEN two files for a read, 
read in each byte in tandom, compare them, then flag to the 
screen when something wasn't quite right. Not that complex. 
Needless to say, my 5 minutes of tedious labour found the 
problem, A byte was mixed up in my disassembly, therefore 
the new code would always err out. Once the byte was fixed, 
the code was great. A happy ending. And so, the BASIC version 
of File Convert became part of my already overflowing archives 
of limited use programs. 

Enter the utilities issue. A perfect occasion for the rebirth of a 
concept long forgotten. With a burst of BAID. and a final lunge 
with PAL, File Compare, machine code version, was born. No 
longer the boring little BASIC ditti that took forever to hnish. 
This one goes like a bad odor on a windy day, which means, it 
goes like stink. For an encore it will generate its report to your 
screen or printer. The best part of this one is the fact that, as 
Chris Zamara says, it doesn't do you any favours. It simply does 
its job without messing up your computer in the process. A 
simple bit of code for a simple task. 



The display is formatted to first show the index (ie. 0-max) into 
the file that the mismatch was found, followed by the byte 
value found in the first file, then the byte value from the second 
file. Everything is displayed in hex. If no errors are found, the 
files will simply be read through without any great excitement. 
When complete, it will return to perform a BASIC warm start 
back to READY mode. Very simple. 

If you specify a file that doesn't exist, the program will under- 
stand and close everything up, then return to BASIC without 
harm. If you find that you have to STOP the program, for 
whatever reason at all, press the STOP key, and control of your 
computer will be passed back to you, with all files correctly 
closed up. 

Quick note before the code. ST is checked after the byte is 
taken from the second file specified, if you know that one file 
will be larger than the other, and don't want to extend beyond 
the limit of the smaller one, then specify the larger file first, the 
smaller one last. This will save a display full of $OD"s from the 
small hie in comparsion to the larger on. The two files will not 
match too well at this point, so you will generate a report of 
garbage. 

Please remember to SAVE the program(s) below before running 
them. Even though it creates another program for you, it won't 
hurt to have the generator around in case of an error. 



Th« "h-anMictor 



72 



VqIuitio 5, luue 06 



CP 
MC 

Fl 
HF 

PI 

DE 

DH 

IP 

OB 

MC 

KB 

GC 

FF 

HH 

NE 

Bl 

MB 

JP 

OE 

JG 

ED 

FC 

MM 

OB 

FG 

DE 

JL 

HO 

PH 

MJ 

HO 

JA 

OJ 

HA 

Dl 

IM 

BM 

KC 

FC 

AE 

AP 

BA 

KE 

HN 

HC 

GC 

HE 

PJ 

CF 

CH 

BL 

HK 

IM 

IL 

FB 

CH 

JB 

PP 



File Compare: BASIC 4.0 Version 

10 rem save"0:fitcomp pet.dat",8 
1 00 rem »• rte/84 - data to create 

'Hie compare 4.0' on diskette as prg 
110 input' drive #, new program name ";dr$,fl$ 
120open15,8,15:open5,8,5,(dr$)+";" 

+ fl$+\p,w" 
130 input#15,e,e$.b,c: if e then close 15: 

print e,e$,b,c: stop 
140forj = 1025to 1409: read x: print#5,ctir$(x);: 

ch = ch + x: next: close5 
150ifch<>39775then 

print ■ ctiecksum error " : end 
160 print'** program complete ««": end 
170: 



1 80 data 1 , 
190 data 49, 
200 data 42, 
210 data 79, 
220 data 46, 
230 data 160, 



4, 37, 4, 10, 0,158, 32 

48, 54, 51, 32, 58, 32, 42 

32, 70, 73, 76, 69, 32, 67 

77, 80, 65, 82, 69, 32, 52 

48, 32, 42, 42, 0, 0, 

71, 32, 29, 187, 32 

90, 201 



5, 169 
240 data 207, 255, 56,233, 48,133 
250 data 3, 48,244,233 
260 data 13, 32,210,255, 169, 
270 data 169, 1,133,210,165, 
280data169, 255, 133, 211, 32, 
290 data 0, 133, 87, 133, 
300 data 5, 169, 97, 32, 
310 data 160, 5, 169, 97, 
320dala155, 201,239, 208, 



330 data 162, 5, 
340 data 133, 89, 
350 data 198, 255, 

360 data 133, 91, 
370 data 240, 
380 data 169, 
390 data 49, 
400 data 87, 



5, 176,240, 169 

0, 133,209 

90, 133,212 

99.245, 169 
162, 5,160 

5, 162, 6 
11, 5,165 

76. 246, 4 
32, 207, 255 



88, 

11. 

32, 

3, 



78, 
36, 



32, 198,255, 

32,204,255, 162, 6, 32 
32,207,255, 72,165,150 
32,204,255,104,197, 89 
72, 162, 1, 32,201,255 
32,210,255,165, 88, 32 
5,165, 88, 32, 61, 5,165 
32, 49, 5, 165, 87, 32, 61 
410 data 5,169, 32, 32,210,255,169, 36 
420 data 32,210,255,165, 69, 32, 49, 5 
430 data 165, 89, 32, 61, 5,169, 32, 32 
440data210, 255, 169, 36, 32,210,255,104 
450data 72, 32, 49, 5.104, 32, 61, 5 

13, 32,210,255, 32,204,255 
87, 165, 87,208, 2,230, 88 
91,208, 3, 76,110, 4,169 
32,226,242, 169, 5, 32,226 
500 data 242, 169, 6, 32,226,242, 32,204 
51 data 255, 76, 255, 1 79, 1 34, 21 0, 1 34, 21 1 
520 data 32, 29,187, 32,226,180,162, 



460 data 169, 
470 data 230, 
480 data 165, 
490 data 1 , 



530 data 189, 0. 2, 

540 data 134, 209, 169, 

550data133, 219, 169, 

560 data 245, 96, 74, 

570data112, 5, 32,210,255, 96, 41, 

580data170, 189, 112, 5, 32,210,255, 



240, 3,232,208,248 

0,133,218,169, 2 

8, 133,212, 32, 99 

74, 74, 74,170,189 

15 

96 

67, 82, 69, 



590 data 51, 41, 32, 83, 67, 82, 69, 69 

600 data 78, 32, 79, 82, 32, 52, 41, 32 

610 data 80, 82, 73, 78, 84, 69, 82, 32 

620 data 58, 0, 68, 82, 35, 58, 70, 73 

630 data 76, 69, 78, 65, 77, 69, 32, 62 

640 data 0, 48, 49, 50, 51, 52, 53, 54 

650 data 55, 56, 57, 65. 66, 67, 68, 69 

660 data 70 



LC 

IH 

Fl 
HF 

PI 

CG 

CG 

IP 

OB 

ID 

BA 

GC 

OF 

CG 

NB 

Bl 

NB 

AB 

CH 

NG 

ED 

JD 

AG 

BC 

FG 

DE 

DM 

HO 

PH 

MJ 

DP 

JB 

KK 

DB 

DJ 

IM 

BO 

KC 

FC 

ME 

MO 

NP 

PG 

NC 

HC 

HE 

LG 

NJ 

OF 

OH 

BL 

HK 

IM 

IL 

FB 

CH 

JB 

PP 



File Compare: Commodore 64 Version 

lOrem save"@0:fiicomp c64.dat". 8 
100 rem -- rte/84 - data to create 

'file compare c64' on diskette as prg 
1 1 input " drive #, new program name " ;dr$,fl$ 
120 open 15,8,15: open 5,8,5,(dr$)+ " : " 

+ fl$+",p,w" 
130input#15,e,e$,b.c: if e ttien close 15: 

print e,e$,b,c: stop 
1 40 for j = 2049 to 2433 : read x: print#5,chr$(x);: 

ch = ch + x: next: close5 
150ifch<>38861 then 

print " checksum error " : end 
160 print" •• program complete ** ": end 
170: 



180 data 1, 8, 37, 

190 data 50, 48, 56, 

200 data 42, 32, 70. 

210 data 79, 77, 80, 

220 data 54, 52, 32, 

230 data 160, 9, 169, 



8, 10, 0,158, 32 
55, 32, 58, 32, 42 
73, 76, 69, 32, 67 
65, 82, 69, 32, 67 
42, 42, 0, 0, 
71, 32, 30,171, 32 
48, 133, 90,201 
5,176,240,169 



240 data 207, 255, 56,233, 

250 data 3, 48,244,233, 

260 data 13, 32,210,255,169, 0,133,183 

270data169, 1,133,184,165, 90,133,186 

280data169,255,133, 185, 32, 74,243,169 

290 data 0, 133, 87, 133, 

300 data 9, 169, 97, 32, 

310 data 160, 9, 169, 97, 

320 data 145, 201, 127,208, 

330 data 162, 5, 



340 data 133, 89, 
350data198, 255, 
360data133, 91, 
370 data 240, 
380 data 169, 
390 data 49, 
400 data 87, 



78, 
36, 



88, 162, 5, 160 
11, 9,162, 6 
32, 11, 9,165 
3, 76,246, 8 
32,198,255, 32,207,255 
32,204,255,162, 6, 32 
32,207,255, 72,165,144 
32,204,255,104,197, 89 
72, 162, 1, 32,201,255 
32,210,255, 165, 88, 32 
9, 165, 88, 32, 61, 9, 165 
32, A9. 9, 165, 87, 32, 61 
410 data 9,169, 32, 32,210,255,169, 36 
420 data 32,210,255,165, 89, 32, 49, 9 
430 data 165, 89, 32, 61, 9,169, 32, 32 
440data210, 255, 169, 36, 32,210,255,104 
450data 72, 32, 49, 9,104, 32, 61, 9 

13, 32,210,255, 32,204,255 
87,165, 87,208, 2,230, 88 
91,208, 3, 76, 110, 8, 169 
32, 145,242, 169, 5, 32, 145 
500 data 242, 169, 6, 32,145,242, 32,204 
510 data 255, 76, 116, 164, 134,184, 134,185 
520 data 32, 30,171, 32, 96,165,162, 
530 data 189, 0, 2,240, 3,232,208,248 
540data134, 183, 169, 0, 133, 187, 169, 2 
550data133,188, 169, 8,133,186, 32, 74 
560data243, 96, 74, 74, 74, 74,170,189 
570data112, 9, 32,210,255, 96, 41, 15 
580data170, 189, 112, 9, 32,210,255. 96 
590 data 51, 41, 32, 83, 67, 82, 69, 69 
600 data 78, 32, 79, 82, 32, 52, 41, 32 
610 data 80, 82, 73, 78, 84, 69, 82, 32 
620 data 58, 0, 68, 82, 35, 58, 70, 73 
630 data 76, 69, 78, 65, 77, 69, 32, 62 
640 data 0, 48, 49, 50, 51, 52, 53, 54 
650 data 55, 56, 57, 65, 66. 67, 68, 69 
660 data 70 



460 data 169, 
470 data 230, 
480 data 165, 
490 data 1 , 



[ Thg Trantoctor 



73 



Volum* 5, l««UB Ofi 



' PLERSE HELP 
X BUMP 

flCCIDENTLY 




ii/innin)i))i}i/. 



r 




T 





OK^ DtlCTCHlo! 
^ ) YtftMl HOW ftft<»wr 

IN unC Coo • 









■r^^ £3 CH Cl ti 



_^ '=fjjc:f e* Q O- O 



h 

CD 

a 

3 




THING* ^MRT GO ^CUCK click" IN THE NICHT 




LAST CHIii^Ct ! TAINT I 







HOUj COA\pUT€a5 



Th« Transactor 



74 



Volume 5, Issuo 06 




'-i5'-j'j:jjjj 






■s-i 




ICPSPTNN SVNTKJC IS ONTHt WKV TO 
DR. FL0T5K: "^ - — ^^ ' '■"^'^ "^^^ 
IS m D^M&ER. 



DR. FL0T5KV'5 H0U5t WHO HE. BEULVE 




tJUMBTO 
F\NO TH' 

DOOU? 

ChPTh\Vl 



<^' 



THE PLhMS 

FOR H15 NEW . 
V\IND EXPANDER. 

ONM)lbK,HWJ 

INTO THE 










VLilR TOO 

FLOTSKN'S 
^>NAJCHED/ 



rmjt^kA 




E\TKER! 






:rw-ti 



yjj 



■4 



TV\EREb NO 

LOOK sonE- 

VIHt^E' 
ELSE 






'^^ 




DO you 

vmOW ABOUT 
;TV\tD\SKT 



^'■ 




K^t.LW). \Y SOMEOME USES 

THt CH\p lUL wRo^^tw^v. 

TV\t\efNM CONTROL K 

P£usow'bniut)ORnK\<£ 

G0TTKVlU\i FIOTSKX, HiS 

I)\'SK hHtJ VJHQEMtRTOO^ 
tV\.?F\ST.'.' 





It'll Backup a Disk in 6 Nanoseconds! 




My Time Warp program is almost done. 
I just have to de-bug the re-entry routine 



Th« Tran joclor 



75 



Valum« 5, l*su* 06 



News BRK 



New 16-bit Commodores for 1985 

Commodore plans to regain its position in t tie 
business market with three new entries for 
1985. 

The much-rumored IBM compatible based 
on the Canadian Hyperion is slated for intro- 
duction in tlie spring of 1985. 

The first half of 1985 should also see the 
release of Commodore's multi-tasking 
Z8000-based machine that was first seen in 
April 1984 at the Hanover computer fair in 
West Germany. This Machine will support 
multiple users and run an operating system 
based on UNIX Version 7. 

Probably the most exciting of the new ma- 
chines will come from Commodore's acquisi- 
tion of Amega Corp. of Santa Clara, Calif. The 
Amiga-derived Commodore is expected to 
be introduced at Chicago's Consumer Elec- 
tronics Show in June 1985. Tlie machine will 
have a 68000 processor, as well as dedicated 
processors for animation, graphics, and 
sound (including voice synthesis), Graphics 
are a strong point, with super high resolution 
AND 32 colours from a palette of 3,000. 

There's also the C128, a souped up 64 with 
128K RAM and 80 column monochrome or 
colour display output, A portable machine 
was also shown to compete with the other 
LCD "lap-tops". For a more detailed report of 
the Consumer Electronics show in Las Vegas, 
see the February TPUG maga2ine. 

Note to Product Review Authors 

The Transactor is getting away from product 
reviews and prints product comparisons in- 
stead. If you have a product review you'd like 
to submit, contact TPUG magazine. Nick Sul- 
livan, a regular contributor to The Transactor 
(Author of the TransBASlC series) is now the 
editor of TPUG and tells us he'd be happy to 
consider software or hardware reviews for 
publication. 

If you'd like to write a product comparison for 
the Transactor let us know the subject in 
advance before submitting the article. An 
example of a good product comparison would 
be one comparing the popular sketching pro- 
grams like Flexidraw, Koala Pad, Doodier, 
Texlsketch,CADpic, etc. 

Over 4 1 ,000 Attend World of 
Commodore 11 Show In Toronto 

The second World of Commodore show at 
Toronto's International Centre attracted 
4U516peopleover its four day run. Commo- 
dore had a large display at the show, but held 
back on the introduction of their new 16-bit 
machines, displaying mainly the +4 and \Q, 

The winner of the draw for the PET 2001 (a 
collector's item) at The Transactor booth was 
Bill Taylor of Acton, Ontario- 



Transactor Disk Offer Update 

As of this issue there are 5 Transactor Disks: 

Disk 1 ; All programs from Volume 4 
Disk 2: Volume 5, Issues 01-03 
Disk 3: Volume 5, Issue 04 (Business & Ed.) 
Disk 4: Vol. 5, Issue 05 (Hardware/Periphs,) 
Disk 5; Vol. 5, Issue 06 {Aids & Utilities) 

Transactor disks are now available on a sub- 
scription basis through the order form in the 
cenlrespread of the magazine. Disks can be 
purchased individually for $7.95 (Cdn.) each; 
the extra two dollars that was to be charged 
for the first disk has been dropped. 

Perhaps a word of explanation is in order 
here. The original idea was to charge $9,95 
for the first disk you purchased, and we'd 
make up a mailer for that disk (and each 
subsequent one) which contained your 
name, address, paid postage, and a two dollar 
off coupon for future disks. As it turned out, 
post office regulations nixed the mailer idea, 
so we decided to just send disks out on an 
individual basis for $7.95, and offer disk sub- 
scriptions. The subscription is mainly as a 
convenience, since our pricing philosophy 
dictates a rock-bottom price for single disks, 
and the discount for a subscription rather 
than individual purchase isn't that greaL 

To anyone who already sent in $9,95 for their 
first disk we'll credit the two dollars toward 
future disks or subscriptions. 

The Complete Commodore 
Inner Space Anthology 

We are now taking orders for the long 
awaited second edition of the Special Refer- 
ence Issue. As you can see, the title is some- 
what different than its predecessor, but then 
so is the inside. Of course most of the material 
from the first edition is included, with as 
much again added. See the back cover ad. 

The price? Just $12.95! Originally the price 
was projected at around $25 dollars. Two 
reasons account for the difference. First, the 
disk we intended as part of the package will 
now be made available separately (details 
next issue). Secondly, we have decided to 
publish the book on our own. Previously we 
had considered releasing the book to an out- 
side publisher but by doing it ourselves the 
price can brought down substantially. 

The Complete Commodore Inner Space An- 
thology is currently available by mail order 
only through The Transactor. The easiest 
way to order is with the postage paid reply 
card at the center of the magazine, Mark the 
card appropriately and don't forget your 
postal/zip code. If you're paying by charge 
card, please include the expiry date. If you're 
sending a cheque, you can tape the postage 
paid card to the outside of an envelope. 
Please allow 4 weeks for delivery. 

Autographed by Jhn Butterfield 

At this moment we have 50 autographed 
copies of Jim Butterfield^s book, "Machine 



Language for the Commodore 64, and other 
Commodore Computers". 49 of them will be 
availablefor$i7.95each(no taxes). The 50th 
we'd like to keep for ourselves. 

To gel one, act fast. Remember, this notice is 
printed 63,000 limes so they won't last long. 
You can even use the postage paid reply card 
at the center of this issue - just be sure to 
specify the book title on the card. 

Product News: 

IBM COMAL 

IBM hasn't officially announced it yet, but the 
word is that they will soon offer COMAL for 
the PC. XT. AT, and PCjr machines. It will be 
completely compatible with the COMAL 2.0 
cartridge for the Commodore 64, 

The Gold Disk 

The gold disk is a monthly magazine for the 
C64 in disk format which contains high qual- 
ity software. Each issue has a feature program 
(eg, December's feature was an easy to use 
Database), an arcade-style game, a home 
finance program with accompanying article, 
educational programs, and a crossword puz- 
zle. There is also a regular graphics column, a 
music column, and programming tips. An 
assembler, word processor, information man- 
agement system, and FORTH are planned as 
the feature program for future issues. 

All programs and articles on the disk are 
accessed from a main menu, and the menu 
can be easily re-entered without leaving the 
gold disk environment. 

The Gold disk costs $15.00 (Cdn.) for a single 
issue, $70.00 for a 6 month subscription, or 
$127.00 for 12 months (plus $1.00 shipping 
and handling for each issue). Contact: 

The Gold Disk 
2^9 Dunwin Drive, *6 
Mississauga, Ont. 
Canada L5L 1X3 

Quick Data Drive For C64 and VIC-20 

The Quick Data drive from Entrepo Inc. of 
Sunnyvale, CA is a high-speed replacement 
for the C2N datasette unit. It works with tiny 
tape cartridges called "micro wafers'' which 
can store from 16K to 128K of data. An 
operating system which comes with the drive 
called QOS (Quick Operating System) allows 
norma! BASIC I/O commands (OPEN, SAVE. 
LOAD, etc.). Files are stored sequentially on 
the wafer, but the drive will search a given 
filename, appearing like a 1541 disk drive to 
the user. Average access time to locate a file 
on a 65K microwafer is 25 seconds. Once 
located, data communication rates are 
claimed to be 15 times faster than the C2N 
datasette (that's faster than a 1541 disk 
drive!). 

Price for the drive and software on microwa- 
fer is $129.95- Microwafers cost approxi- 
mately $5.00 depending on storage capacity. 



Tlwlhinfactor 



76 



Voluni* 5, l»ii« 06 



Entrepo 

J 294 Lawrence Station Road 

Sunnyvale, CA 

USA 94089 

Software Developers Newsletter 

The Software Developers Association is a 
non-profit associalion of computer software 
developers, and others in related areas, who 
have joined together to strengthen software 
development in Canada. 

The Software Developers Association News- 
letter is a monthly publication produced and 
distributed by the Software Developers Asso- 
ciation for our members and friends of a 
developing Canadian software industry. For 
further information, please contact, Bob 
Bruce, Chairman, Software Developers Asso- 
ciation. 

Computer Software And Human Develop- 
ment Conference 

The impact of computer software on the fu- 
ture of business and education will be exam- 
ined at an international conference 
sponsored by the Ontario Software Devel- 
opers Association in conjunction with the 
Third Annual Software Panorama at the 
Royal York Hotel in Toronto, May 22-24, 
1985. 

Senior business, government and academic 
representatives from 160 counlries are being 
invited to attend the Computer Software and 
Human Development Conference which will 
examine the many dimensions of software 
development and its impact on business, ed- 
ucation, heallh and agriculture. The Software 
Panorama will also provide an opportunity 
tor software developers to demonstrate and 
market their products. The Canadian soft- 
ware industry is estimated to consist of a 
thousand firms with estimated sales at SI 
billion. The market is expected to grow to $5 
billion by the end oHhe decade. 

The Ontario Software Developers have estab- 
lished an advisory committee of senior indus- 
try representatives to make 
recommendations on various aspects of the 
conference coordination. Focusing on the 
School of the Future, Office of the Future, 
Hospital of the Future and the Farm of the 
Future, the exhibitors and conference are 
expected to underline current and future ori- 
ented developments in software. While the 
conference is expected to centre on trends 
and developments in the industry, it will also 
examine emerging opportunities and the ad- 
justments required in the quickly changing 
industry. Please contact, Reuben Lando, Con- 
ference Coordinator. 

The Software Developers Association 
185 BloorSl. East 
Suile 500 
Toronto, ON 
416 922-1153 



Commodore Now Provides American 
Educational Software in Canada, 

Commodore is now offering software across 
Canada from American Educational Com- 
puter, Inc., one of the leading educational 
software firms in North America. 

"AEC's educational publishing experience 
has led to the development of the most exten- 
sive collection of classroom-related pro- 
grams available, including phonics, word 
skills, reading comprehension, vocabulary 
skills and wodd geography," said Richard 
Mcfntyre, Vice-President ~ Sales, Commo- 
dore, Canada. 

"Unlike many producers of 'educational' soft- 
ware who have entered the market following 
the softening of Ihe game market, AEC was 
founded by experienced educational pub- 
lishers who saw a genuine need for educa- 
tional software that directly related to the 
classroom experience. All AEC software 
products follow standard school curriculum 
material rather than a game format and are 
designed to help student improve classroom 
performance," he said. 

Commodore is looking to increased growth 
from this type of product, according to Mcln- 
tyre. Recent research by Future Computing 
Inc. shows that while personal computer soft- 
ware sales will grow at an annual com- 
pounded rate of 68 percent through 1987, 
educational software will grow at a 7 1 percent 
rate during the same period and that the 
home educational software portion will be 
about 70 percent. 

All AEC software Is compatible with the Com- 
modore 64. Initial products include the 
EASYREADER series and the MATCH- 
MAKER series- The programs are teacher- 
designed and are grade-level oriented to help 
the child all the way through school. By 
paralleling the classroom experience, the 
software consistently teaches lessons tailored 
lo the child's needs. All programs progress at 
the user's own pace, are easy to use and 
require no previous computer experience. 

EASYREADER presents phonics and word 
analysis skills with high resolution graphics 
and full-colour animation and most impor- 
lanlly, correlates with standard school read- 
ing programs. 

MATCHMAKER retains the format system of 
the school version which, in the home, al- 
lows parents to become more active in the 
child's learning process, through the interac- 
tive format. 

Donald R. Thompson, AEC Vice-President & 
Director of Consumer Products Division, 
said, "More important than fun being written 
into the program is ttie fact that satisfaction 
and reward come from success. Our line is 
programmed so the child achieves a high 
level of success. Too many other educational 



programs are really just games that do not 
relate enough to classroom work." 

"AEC programs do contain games, but only 
as rewards for learning achievement," said 
Thompson. For example, once the student 
completes the objective in MATCHMAKER'S 
geography program, he or she can play an 
exciting game, which helps to encourage and 
motivate. The focus is strictly on learning. 

"AEC software has an important advantage - 
its approach has been student-tested under 
actual classroom conditions, so we know it 
keeps the child's interest while it teaches. " he 
said. For more information, please contact: 

Richard Mclntyre 

Commodore Business Machines, Ltd. 

3370 Pharmacy Ave. 

Agincourt, On 

M1W2K4 416 499-4292 



LAMP 

LAMP (Literature Analysis of Microcomputer 
Publications) has made available for sale the 
Annual Cumulative Edition for 1983, mark- 
ing the first complete year of publication for 
this international index. A bi-monthly jour- 
nal, LAMP presently indexes 130 periodicals 
which deal exclusively with the field of mi- 
crocomputers. This important publication is 
the most comprehensive, single source for 
information on microcomputers as they re- 
late to business, education, the arts, social 
and physical sciences. 

The annual cumulative edition is printed in 
two volumes and encompasses thousands of 
subject and author entries, thousands of re- 
views of books and periodicals, hardware and 
computer systems, educational courseware 
and video games, and information on all 
phases of microcomputers. 

The 1983 year-end issue is available lo non- 
subscribers at $69.95. Or subscribe to LAMP 
for 1984 at the regular annual rate of $89.95 
and take advantage of the special offer of 
$39.95 for the 1983 cumulative edition. For a 
brochure describing LAMP and further infor- 
mation on the hard-cover or microfiche edi- 
tions call toll-free 800 526-9042 or write: 

LAM P/Soft Images 
Brochure Department 
200 Route 1 7 
Mahwah. N J- 07430 



Porthole 

Porthole announces the modern computer 
magazine published entirely on disk for the 
Commodore 64 and VlC-20. The first issue is 
scheduled for January 1985 (or maybe De- 
cember 84) and will be issued six items a 
year. Porthole will have all the features you 
have come lo expect from a complete com- 



Th« IVanKicfor 



77 



V6lum« 5, Uf U0 06 



puter magazine. Feature Articles, Games. Re- 
views, Education, Programming Tutorials, 
Letters and, yes, even advertising and new 
product announcements. But one thing you 
will never have to do again is to key in a 
program. Each issue will contain ready to run 
programs selected for a wide range of user 
interests. These will be programs that you 
will want to back up on your own disks - and 
Porthole will lei you do it- 
Porthole is not yet available at your local 
news stand. All sales are by mail. The single 
issue price is $10,00 postpaid. Send your 
orders to: 

Porthole 
P.O. Box 135 
Kerby, OR 97531 

WANTED - Programmers, Authors, Contrib- 
utors, and most of all, Readers! 

SPECIAL OFFER - Send a formatted 1541 
disk with return postage to Porthole. By swift 
return mail Porthole will return the disk 
loaded with information on how to contribute 
to Porthole. But you already know! It's this 
easy. Write a BASIC "program" like this: 

" my name is jane, porthole sounds 

1 "terrific, this isn't the best word 

2 " processor but it works! do you 

3 "have something better? return by 

4 " disk to 555 pal road, lincoln, ne 

Don't goof up. Send return postage or Port- 
hole gets a free disk. Sorry, letters without a 
disk must wait on the poop deck for the galley 
to empty. 

EXTRA SPECIAL OFFER - Send a disk and 
$5,00 and ship out in steerage. Enjoy the 
view everyone else will see thru the Porthole 
window at half the price. This offer may not 
be repeated. 

Don't miss this adventure in computing. Let's 
do it right - throw away those pencils and 
paper. Start your drives and enjoy the new 
spirit of magnetic publishing! For more de- 
tails, contact: 

Raymond Quiring 
Porthole Disk 
P.O. Box 135 
Kerby, OR 97531 
502 592-4594 



New Income Tax Program 
For Commodore PLUS/4 

Taxaid Software, Inc. has released a new 
edition of the "TAXAID" income tax prepara- 
tion program for the Commodore PLUS/4 
computer. TAXAID programs have been 
available for other Commodore computers 
since 1981. The PLUS/4 edition was written 
by the experienced tax accountants and is 
designed for home use- 



TAXAID is easy to use with a detailed manual 
that leads the user step by step through the 
data entry. The program is menu driven with 
advanced editing features that allow the user 
to make changes and revisions at any time 
during the data entry process. Data files can 
be saved and reloaded at any stage of the 
program. Calculations are automatic and all 
tax tables, including income averaging are 
built in, TAXAID will prepare any IRS form 
1040. The program features computer gener- 
ated forms for Schedule A, B, C, G, W, and 
Form 2441 as well as a complete listing of 
pagesl&2of the 1040 Form. 

The results can be directed to the monitor or 
the printer. Low cost updates for future tax 
years are published every year. 

TAXAID is available on disk or tape for the 
Commodore PLUS/4 at a cost of $29.95. For 
more information, contact: 

Taxaid Software, Inc. 
606 Second Ave. S.W. 
Two Harbors, MN 5561 6 
217734-5012 218834-3600 



INFOQUICK Bulletin Board 
for the Commodore 64 

Expandability: Can run on a single disk drive 
or as many as 4 dual drives. Up to 16 sub- 
boards for messages (including 4 privileged 
areas). Files library can be expanded to an 
unlimited number of sub-directories 
{^'downloading"). Up to 400 users, 800 mes- 
sages. 

Speed; 100% machine language. Entire pro- 
gram and all menus are loaded once - no 
time consuming "chain ing'\ Full type-ahead. 
Menus cut off instantly when commands are 
typed. Abbreviated menu option. 

Flexibility: Runs on all Commodore and MSD 
disk drives. Runs on all the most popular 
modems. Can be run so users create their 
own fully-validated accounts or with user- 
created accounts requiring SYSOP validation 
or with all new unvalidated users on a single 
"generic" account. Can use standard ASCII or 
Commodore ASCII. Messages are automati- 
cally reformatted for the terminal of the user 
reading them. Changeable SYSOP name. 
SYSOP-selectable time limits on inactivity 
and on the total length of calls. SYSOP- 
definable welcome and warning messages. 
Uploads or downloads can be temporarily 
disabled. Optional remote SYSOP usage - 
can be easily enabled and disabled. 300/ 
1200 baud operation. 70-plus page detailed 
manual. File transfers either as straight text 
or using the industry-standard XMODEM 
protocol with error checking. Read/scan 
messages since last call, forwards, reverse, by 
sender, by recipient; optional mark during 
scan for later read, Find-and- replace text 
editor for message entering SYSOP desig- 
nated "bulletins" shown to each user or to a 



subset of the users. Convenient reply-delete 
option after reading each message. SYSOP 
can change public messages to private, for- 
ward a copy of a message (optionally editing 
it first), re-assign a message to a different 
sub-board- Real-lime log of logins, logoffs, 

and file transfers. Multi-line descriptions of 
each file and sub-directory. "Privileged" 
messages and files completely invisible. Op- 
tional transcript to printer. Scan userlist t)y 
users' interests, location, SYSOP/user chat 
initiated by either SYSOP or by user, 

INFOQUICK - Your once and future BBS. 
Suggested retail $139 {U.S.). Ask about SY- 
SOP referral rebate. Dealer inquiries wel- 
come. 

For more INFO QUICK-ly call 61 7 547-0340 
or contact these operational INFOQUICK bul- 
letin boards: 

617 823-6140 MASSPETll 

203 397-3381 MicroTechnic Solutions 

203 481-9974 SAlLSoftware 

The SMART 64 Terminal +4 

The SMART 64 Terminal +4 is a greatly 
enhanced version of this versatile terminal 
communications package for the Commo- 
dore 64 which is already in home education 
and business environments. New features 
include VT52/VT 1 00 emulahon when appro- 
priately configured with 80 column hard- 
ware, XMODEM file protocol for direct-disk 
transfers of programs and text, HELP screens 
for instant reference. 300/1200 baud full- 
speed downloading, direct printing of the 
28K memory buffer, and an expanded status 
line. Convenience items such as software 
alphabetic shift, linefeed toggle, word-wrap 
control, time-of-day clock and alarm clock, 
key-repeat toggle, screen print, single key- 
stroke ID and password transmission, color 
adjustment, and echo mode provide the user 
with a comfortable operating environment, A 
built-in disk command processor lets the 
user manage disk files directly. The PetAscii/ 
ASCII translation tables are adiustable by the 
user, and can be deactivated by toggle con- 
trol. Four redefinable function keys are avail- 
able for storing multi-line tet strings, up to 80 
characters each. Text uploads directly from 
disk are accommodated in either continuous 
or prompted mode. Automatic answerback to 
ENQ is provided, as well as a BREAK function 
for communicating with mainframes. The 
SMART 64 Terminal supports all direct- 
connect modems and most RS232 modems, 
including Hayes. 

A separate version of the product supports 
the COMvoice speech synthesizer to provide 
the user with a TALKING terminal. The Smart 
64 Talking Terminal offers ail of the features 
of the 40 column mode in the standard pack- 
age, with the exception of word-wrap con- 
trot, which is replaced with two new ones 
more appropriate to an audio- based product; 
toggle voicing and phrasing of words or let- 



Th« Transactor 



78 



Volume 5, lisu» 06 



lers. The voicing toggle allows silent, high- 
speed downloading of extensive tet for play- 
back offline, or the real-time voicing of data 
as it is received by the modem. The phrasing 
control can be switched to letters for intelligi- 
ble reception of unpronounceable letter 
groupings such as securities stock-trading 
symbols. Users can make back-up copies. 
Suggested retail for both versions is $39,95 
(U.S,), Availability information from: 

Microtechnic Solutions Inc. 
RO. Box 2940 
New Haven, CONN 06515 
203 389-8383 



The FONT FACTORY 
VIC-1525/MPS-801 
Printing Enhancement System 

The FONT FACTORY will read any standard 
Commodore 1541 ascii sequential file, auto- 
matically format, and print out the document 
in any font that is selected. With this ability, 
the FONT FACTORY will read text files pro- 
duced by many of the popular Commodore 
64 word processors and produce a more pre- 
sentable and interesting document. The user 
has full control over all page formatting, such 
as, page length, line width, left margin, lop 
margin, line spacing, headers, footers, page 
numbering, justification, etc. 

The FONT FACTORY includes an easy-lo- 
use Font Generator to create or edit your own 
fonts. Fonts may be as large as 9x7 pixels, 
and may be printed in normal or double 
width formats. 

The FONT FACTORY has the ability to mix 
up to fifteen different fonts within a single 
document. Thirteen embedded commands 
are available to give the user the ability to 
reformat different areas of text within the 
document. Use your word processor in con- 
junction with the FONT FACTORY to turn 
your 64 into a complete typesetting system! 

The FONT FACTORY is user friendly and 
entirely menu driven. Eight preformatted 
fonts are provided including one with True 
Lower Case Descenders, when you purchase 
the FONT FACTORY. Additional Font Disks 
may be purchased separately. 

Micro-W Disl, Inc. 
1342B Route 23 
Butler, NJ 07405 
201 838-9027 



CAM-64 (Call AccoundDg Manager) 
Phone Call Processing Software 

Input Systems, Inc., designers and publishers 
of popular business software for Commodore 
Microcomputers^ announces the release of 
their new software for monitoring multi- 
station phone usage- 



CAM-64 was designed for companies with 
new telephone systems, or ETN systems. The 
program organizes SMDR data output from 
the phone system switching computer, CAM- 
64 utilizes the famous cost efficient Commo- 
dore 64 Computer, disk drive and printer. 
The CAM-64 System is Menu driven from an 
Auto Load Module, plugged into the cartridge 
slot of the Commodore 64. It will function on 
any phone system which utilizes Station Mes- 
sage Detail Recording (SMDR). such as Mitel, 
AT&T and others. 

The system handles up to 2500 phone calls 
per disk, using a single Commodore i541 
Disk Drive. It will sort calls into several cate- 
gories and sub- categories, and will send for- 
matted printouts to a computer monitor, TV, 
or printer. Each format may be selected from 
a Menu. 

CAM-64 will sort outgoing call information 
by: 

(1) St at ions/ Extensions {handles up to 100 
stations) 

(2) Area Codes 

(3) Common Carriers (up to 4, such as Micro- 
tel. Sprint, etc.) 

For further information, contact: 

Input Systems, Inc. 
15600 Palmetto Lake Drive 
Miami, FL 33157 
305 253-8100 

Expandable 300/ 1 200 Baud Phone 
Modem With Clock /Calendar 

ProModem 1200 from Prometheus Products 
is a Hayes compatible Bell 212A, 300 and 
1200 baud pfione modem with built-in 
clock/ calendar- The unique design provides 
the ability to add an optional buffer memory 
with up to 64K of storage. 

Standard features include Auto-Answer and 
Auto-Dial, Programmable Intelligent Dial- 
ing, Tone and Pulse Dialing, Built-in Speaker 
with Volume Control, separate phone and 
data jacks to permit switching between voice 
and data, and simple yet powerful diagnos- 
tics. Suggested list price is $495 (U.S.}. 

The ProModem 1200 can be purchased with 
the optional buffer installed or it can be 
added later. The buffer card comes with 2K of 
battery backed- up CMOS memory to protect 
time, date, operating parameter, and other 
data stored in memory from loss during 
power down. The buffer card lists for $99 
(U.S.). Additionai memory, in increments of 
16K is available up to a maximum of 64K- 

Memory in ProModem 1200 is dynamically 
allocated between '^Directory" and ^'Buffer". 
The user can store telephone numbers, ac- 
cess codes, and log on messages in each 
directory entry. Up to 12 reference characters 
can be used to "call up'' entries in the direc- 



tory and initiate unattended dialing. 

The buffer is used to store messages in the 
modem for transmission at a preset time, per 
the internal clock/calendar, to a specified 
group of phone numbers from the directory. 
In the auto-answer mode, incoming mes- 
sages are automatically stored and the time 
recorded. Operation of ProModem can be 
unattended, with or without the host com- 
puter being operational. 

A plug-in twelve character alphanumeric dis- 
play is available for $99 (U.S.) list price. It 
shows operating status, diagnostic messages, 
phone numbers, and time/date information- 
Delivery of the ProModem 1200 is 2 weeks 
from the factory or from stock via Prome- 
theus' dealers. For additional information 
contact: 

Robert Christiansen 
Prometheus Products, Inc. 
45277 Fremont Blvd. 
Fremont, CA 94538 
415 490-2370 

Printer Ribbons for 

Commodore 1526/4023 And Others 

Aspen Ribbons, Inc., of Lafayette, Colorado, 
is pleased to announce the Aspen Ribbons 
brand replacement for the Tally/ 
Mannesmann Spirit 80 (SP80) multistrike rib- 
bon. One hundred percent compatible to the 
ribbon from the original equipment manutac- 
lurer(OEM), its specifications are 1/2" x 100 
ft., with multistrike film. Use this ribbon on 
the following printers: 



Accord DC80 

Blue Chip Enterprises M 1 20/ 10 

BMC Internationa] BX-80 

Cal-Abco Legend 80 

Commodore 1526 

Commodore 4023 

Formula SP80 

ITT Xlra 

Legend 800 

Lein Yig Computer Corp. YL-80FPT 

Mitsubishi Super VCP80 

Multi-Tech Compumate CP800 Type 1 

Okidata 1600 Printer 

Ortrona AT-80 

Suminon 840 

Tally/Mannesmann Spirit 80 (SP80) 

Tally Spirit MT80 Microprinter 

Yocobushi Computer Union CO FP-80 



• 
• 

■ 
• 



Prices for this ribbon range from $6.00 to 
$3.34 (U.S.) depending on the quantity or- 
dered. Color ribbons are not available at this 
time. For more information, please contact: 

Aspen Ribbons, Inc. 

555 Aspen Ridge Drive 

Lafayette> CO 80026 

303 666-5750 or 800 525-9966 



Th« TronKictor 



79 



Volume 5, Issue 06 




Th* r«<h'nvw> Jouf rtflJ F4^ Commwlfirt Cdfnputari 



PAYS 
$40 



per page for articles 

We're also looking for 

professionally 

drawn cartoonst 

Send all material to: 

The Editor 

The Transactor 

500 Steeles Avenue 

Milton, Ontario 

L9T3P7 



Volume 5 Editorial Schedule 



Issue* Theme 


Copy Due 


Printed 


Release Date 


1 Graphics and Sound 


Febl 


Mar 19 


April 1 


2 The Transition to Machine Code 


Apr! 


May 21 


June 1 


3 Software Protection & Piracy 


Jun 1 


Jul 23 


August 1 


4 Business and Education 


Augl 


Sep 17 


October 1 


5 Hardware and Peripherals 


Oct I 


Nov 19 


December 1 


6 Programming Aids & Utilities 


Dec 1 


Jan 19 


February 1/85 



Volume 6 Editorial Schedule 



I 


Communications & Networking 


Febl 


Mar 21 


April 1/85 


2 


Languages 


Apr 1 


May 20 


June 1 


3 


Implementing Tlie Sciences 


Jun 1 


Jul 18 


August 1 


4 


Hardware & Software Interfacing 


Augl 


Sep 21 


October 1 


5 


Real Life Applications 


Octl 


Nov 19 


December 1 



Advertisers and Authors should have material submitted no 

later than the 'Copy Due* date to be included 

with the respective issue. 




(1) DISK BASED COMAL Version 0.14 

• COMAL STARTER KfT-Commodore e^" System Disk, Tutorial 
Disk {interactive book), Auto Run Demo Disk, Reference 
Card and COMAL FROM A TO Z book. 

S29.95 plus 52 handling 

(2) PROFESSIONAL COMAL Version 2.0 

• Full 6dK Commodore 64 Cartridge 
Twice as Powerful, Twice as Fast 

S99.95 plus S2 handling (no manual or disks} 

• Deluxe Cartridge Package Includes: 

COMAL HANDBOOK 2nd Edition, Graphics and Sound 
Book, 2 Demo Disks and the cartrfdge (sells for over 
S200 in Europe). This is what everyone is talking about. 
S128-90 plus S3 handling (USA & Canada onlyi 

CAPTAIN COMAL^ Recommends: 

The COMAL STARTER KIT IS ideal for a home programmer It 
has sprite and graphics control (LOGO compatible]. A real 
bargain— 529.95 for 5 full disks and a user manual- 
Serious programmers want the Deluxe Cartridge PacT^age. 
For S128 90 thev get the best language on any 8 Pit 
computer (the support materials are essential due to the 
immense power of Professional comal). 

ORDER NOW: 

Call TOLL-FREE 1-800-356-5324 ext 1307 VISA or MasterCard 
ORDERS ONLY. Questions and information must call our 
info Line 608-222-^432. All orders prepaid only— no CCD. 
Send check or money order in US Dollars to. 

COMAL USERS CROUP, aS.A., LIMITED 

5501 Croveland Ter. Madison, Wl 53716 

TRADEMARWS Commodore M of COmmoaare Eiecironi« Lto^ captam COMAL of 
COMAL u^ers Croup, U.S.A. ltd 
t estlrrvsted 



COMMODORE OWNERS 




Join the world s largest, active Commodore 
Owners Association. ■ 

• Access to thousands of public domain programs 
on tape and disk for your Commodore 64, V1C_20 
and PET/CBM. 

" Monthty Club Magazine 

• Annual Convention 

• Member Bulletin Board 

• Local Chapter Meetings 

Send $1.00 for Program Information Catalogue, 

(Free with membership). 



Membership 
Fees for 
12 Months 



Canada — $20 Can, 
U.S.A. ^ $20 U.S. 
Overseas — $30 U.S 



T.P.U.G. Inc. 

Department ' M ' 

1912A Avenue Road, Suite 1 

Toronto, Ontario, Canada M5M 4A1 

• LET US KNOW WHICH MACHINE YOU USE - 





"^de youi co-ordmales onto the 
: owered order form and every pro- 

Pgr rom each issue will be locked i 
I eneryf^ed, and transported from our sta" 

; base •:^\y to yours! Warp 9 will seem 

^slow """" oared to the time you save typinr 

and thtt programs wifl give your machine 4| 

mm !f>ok and feel of a fresh set of Dilithium 

vii*tjai Coast through the Neutral Zone 

with The Transactor Disk! 

Only $7.95 Each! 
6 Disk Subscription 

Just $45.00! 








The Complete Commodore 

Inner Space Anthology 

will look like this: 




i 



WATCH FOR IT! 

January 1985 






without 






know 



you never 




Iran^qdor 

Th*lHllftl^wt J«vriHjT»F C«MinW*tv C*flwvt*rt 



Piease send me 6 consecutive Transoclars starting with the next issue! 

nU.S-A. $15-US. DForeign S21.US. DAit Mail (Overseas only) $40.us. 

includes 14 15 postage j>ei tfisue 



USA 



D Renewal (please include your Subscription Number from mailing label) ________^ 

D New Subscription New address? D 



Nanne & Address 

(please include your postal/zip code): 



Q Please send me The Complete Commodore Inner Space Anthology at $12.95* 



The Transactor Di8k (1541/4040/MSD format) 
D Please send 6 consecutive disks to correspond 
with my magazine subscription: $45.00.* 

Please send the following disks al $7,95' each. 

n Disk I: All programs from Volume 4 

n Disk 2: Programs from Volume 5, Issue 01 to 03 

n Disk 3: Vol. 5, Issue 04 (Business & Education) 

n Disk 4: VoL 5, Issue 05 (Hardware & Peripherals) 

n Disk 5: Current Issue, Vol. 5. Issue 06 (Aids & Utilities) 



Transactor 

n Volume 4, Issue 01 
D Volume 4, Issue 03 

□ Volume 5, Issue 01 
D Volumes, Issue 02 
D Volume SJssue 03 

□ Volume 5, Issue 04 

□ Volume 5. Issue 05 
D Volumes, Issue 06 



Back Issues: $4.50* each. 

D Vol. 4, Issue 02 

(Sound and Graphics) 
(Transition to Machine Language) 
(Protection & Piracy) 
{Business & Education) 
(Hardware & Peripherals) 
(Aids & Utilities) 



Prices are in U.S. Dollars 



NOTE: Prepayment required. Purchase orders will be accepted ONLY if accompanied by payment. 



D Cheque/MO. enclosed 
D Visa D MasterCard 



Cheque*. 
Accl, * 



Dated. 



/ 



Amount. 



&ipires 



./. 



f use the following Commodore equipment: 
DVIC 20 PC 64 

GDatasette Disk Unit: 



04016/32 
D I 540/41 



08032/96 
D4040 



DSuperPET 
08050 



08296 
D8250 



ai6/ +4 

09060/90 



1 use my equipment in the following environment: 
OHobby DBusiness GTechnical 



OPublic School O High School 



DColleee/Univ. OCBM Dealer 



02/85 



n Please send dealer information for The Transactor. 



Irpn^qiplor 



4r4 C«iiif Vf*ri 



Canada 

Name & Address 

(please include your postal/zip code): 



Please send me 6 consecutive Transactors starting with the next issue! 



r 



nCanada$l5. 



DForeign S21.US. 



DAir Mail (Overseas only) $40,U5. 



n Renewal (please include your Subscription Number from mailing label) 

n New Subscription New address? D 



D PleasesendmeTheCompleteCommodorelnnerSpace Anthology at $12.95* 



The Transactor Disk (1541/4040/MSD format) 
n Please send 6 consecutive disks to correspond 
with my magazine subscription: $45.00.' 

Please send the following disks al $7-95' each, 

n Disk 1 : All programs from Volume 4 

n Disk 2: Programs from Volumes, Issue 01 to 03 

D Disk 3: Vol. 5, Issue 04 (Business & Education) 

D Disk 4; Vol. 5. Issue 05 (Hardware & Peripherals) 

D Disk 5: Current issue. Vol 5, Issue 06 (Aids & Utilities) 



Transactor 

n Volume 4, Issued 
n Volume 4. Issue 03 
D Volume 5. Issue 01 
n Volume 5. Issue 02 
D Volumes. Issue 03 
n Volume 5, Issue 04 
n Volume 5, Issue 05 
n Volume 5, Issue 06 



Back Issues; $4.50* each, 

D Voi.4Jssue02 

(Sound and Graphics) 
(Transition to Machine Language) 
(Protection & Piracy) 
(Business & Education) 
(Hardware & Peripherals) 
(Aids & Utilities) 



* Ontario residents please add 7% provincial sales tax. 



NOTE: Prepayment required. Purchase orders will be accepted ONLY if accompanied by payment. 



D Cheque/MO- enclosed 
n Visa D MasterCard 



Cheque*. 
Acct. * 



Dated. 



Amount, 



Eiipires 



/ 



I use the following Comniodore equipment: 



DVIC 20 
DDaiasette 



DC 64 
Disk Unit: 



D4016/32 
ni540/4l 



1 use my equipment in the following environment: 
DHobby DBusiness DTechnical 



08032/96 
D4040 

DPublic School 



DSuperPET 
08050 



D High School 



D8296 
08250 

OColiege/Univ. 



016/ +4 
09060/90 

OCBM Dealer 



O Please send dealer information for The Transactor. 



02/85 



r + 



BUSINESS REPLY MAIL 

FIRST CLASS PERMIT NO 390 BUFFALO, NY 



POSTAGE WILL BE PAID BY ADDRESSEE 

Iransoclor 

277 Linwood Avenue 
Buffalo, NY, 14209-9990 



NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 




lllllllllllMMllMMMMMllMlMlllalllMltMlllll 



^fa^^Bva^ 



A^k 



Business Reply Mail 

No Postage Stamp Necessary 
H mailed in Canada 



Postage witt be paid by: 



■^^ 



Iransoclor 

500 Steeies Avenue 
Milton, Ontario, Canada 
L9T 9Z9